Skip to content

Commit 054de9e

Browse files
committed
FieldValueItem -> FieldValueElementData to exclude DevExpress.Xpf.PivotGrid.Internal namespace
1 parent e564b0f commit 054de9e

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

CS/ContextMenuToShowTopN_Example/MainWindow.xaml.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using DevExpress.DataAccess.Excel;
22
using DevExpress.Xpf.Bars;
33
using DevExpress.Xpf.PivotGrid;
4-
using DevExpress.Xpf.PivotGrid.Internal;
54
using System.Collections.Generic;
65
using System.Data;
76
using System.Linq;
@@ -49,7 +48,7 @@ private void pivotGridControl1_PopupMenuShowing(object sender, PopupMenuShowingE
4948
FieldValueElement fvElement = e.TargetElement as FieldValueElement;
5049
if (fvElement == null) return;
5150

52-
FieldValueItem valueItem = fvElement.ElementData as FieldValueItem;
51+
FieldValueElementData valueItem = fvElement.ElementData as FieldValueElementData;
5352
if (valueItem.IsLastLevelItem)
5453
{
5554
string itemCaption = string.Format("Top 5 Values in this {0}", valueItem.IsColumn ? "Column" : "Row");
@@ -66,13 +65,13 @@ private void pivotGridControl1_PopupMenuShowing(object sender, PopupMenuShowingE
6665
private void Item_CheckedChanged(object sender, ItemClickEventArgs e)
6766
{
6867
BarCheckItem item = sender as BarCheckItem;
69-
FieldValueItem elementData = e.Item.Tag as FieldValueItem;
68+
FieldValueElementData elementData = e.Item.Tag as FieldValueElementData;
7069
if ((bool)item.IsChecked)
7170
SetTopFiveValues(elementData);
7271
else
7372
ResetTopFiveValues(elementData.PivotGrid);
7473
}
75-
private static void SetTopFiveValues(FieldValueItem valueItem)
74+
private static void SetTopFiveValues(FieldValueElementData valueItem)
7675
{
7776
var sortConditions = GetConditions(valueItem);
7877
valueItem.PivotGrid.BeginUpdate();
@@ -87,7 +86,7 @@ private static void SetTopFiveValues(FieldValueItem valueItem)
8786
});
8887
valueItem.PivotGrid.EndUpdate();
8988
}
90-
private static bool IsTopFiveValuesApplied(FieldValueItem valueItem)
89+
private static bool IsTopFiveValuesApplied(FieldValueElementData valueItem)
9190
{
9291
var fields = valueItem.PivotGrid.GetFieldsByArea(valueItem.IsColumn ? FieldArea.RowArea : FieldArea.ColumnArea);
9392
if (fields.Count == 0)
@@ -121,12 +120,12 @@ private static void ResetTopFiveValues(PivotGridControl pivotGrid)
121120
}
122121
pivotGrid.EndUpdate();
123122
}
124-
private static List<KeyValuePair<PivotGridField, object>> GetConditions(FieldValueItem valueItem)
123+
private static List<KeyValuePair<PivotGridField, object>> GetConditions(FieldValueElementData valueItem)
125124
{
126125
var fields = valueItem.PivotGrid.GetFieldsByArea(valueItem.IsColumn ? FieldArea.ColumnArea : FieldArea.RowArea).Where(f => f.AreaIndex <= valueItem.Field.AreaIndex);
127126
return fields.
128127
Select(f => new KeyValuePair<PivotGridField, object>(f,
129-
valueItem.PivotGrid.GetFieldValue(f, valueItem.MinLastLevelIndex)
128+
valueItem.PivotGrid.GetFieldValue(f, valueItem.MinIndex)
130129
)).ToList();
131130
}
132131

VB/ContextMenuToShowTopN_Example/Application.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Application x:Class="ContextMenuToShowTopN_Example.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml">
1+
<Application x:Class="ContextMenuToShowTopN_Example.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="MainWindow.xaml">
22
<Application.Resources>
33

44
</Application.Resources>

VB/ContextMenuToShowTopN_Example/ContextMenuToShowTopN_Example.vbproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>

VB/ContextMenuToShowTopN_Example/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<dx:ThemedWindow x:Class="ContextMenuToShowTopN_Example.MainWindow" Width="750" Height="400" Title="MainWindow"
1+
<dx:ThemedWindow x:Class="ContextMenuToShowTopN_Example.MainWindow" Width="750" Height="400" Title="MainWindow"
22
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

VB/ContextMenuToShowTopN_Example/MainWindow.xaml.vb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Imports DevExpress.DataAccess.Excel
22
Imports DevExpress.Xpf.Bars
33
Imports DevExpress.Xpf.PivotGrid
4-
Imports DevExpress.Xpf.PivotGrid.Internal
54
Imports System.Collections.Generic
65
Imports System.Data
76
Imports System.Linq
@@ -47,7 +46,7 @@ Namespace ContextMenuToShowTopN_Example
4746
Return
4847
End If
4948

50-
Dim valueItem As FieldValueItem = TryCast(fvElement.ElementData, FieldValueItem)
49+
Dim valueItem As FieldValueElementData = TryCast(fvElement.ElementData, FieldValueElementData)
5150
If valueItem.IsLastLevelItem Then
5251
Dim itemCaption As String = String.Format("Top 5 Values in this {0}",If(valueItem.IsColumn, "Column", "Row"))
5352
Dim item As BarCheckItem = New BarCheckItem With {.Content = itemCaption}
@@ -63,14 +62,14 @@ Namespace ContextMenuToShowTopN_Example
6362

6463
Private Sub Item_CheckedChanged(ByVal sender As Object, ByVal e As ItemClickEventArgs)
6564
Dim item As BarCheckItem = TryCast(sender, BarCheckItem)
66-
Dim elementData As FieldValueItem = TryCast(e.Item.Tag, FieldValueItem)
65+
Dim elementData As FieldValueElementData = TryCast(e.Item.Tag, FieldValueElementData)
6766
If CBool(item.IsChecked) Then
6867
SetTopFiveValues(elementData)
6968
Else
7069
ResetTopFiveValues(elementData.PivotGrid)
7170
End If
7271
End Sub
73-
Private Shared Sub SetTopFiveValues(ByVal valueItem As FieldValueItem)
72+
Private Shared Sub SetTopFiveValues(ByVal valueItem As FieldValueElementData)
7473
Dim sortConditions = GetConditions(valueItem)
7574
valueItem.PivotGrid.BeginUpdate()
7675
ResetTopFiveValues(valueItem.PivotGrid)
@@ -84,7 +83,7 @@ Namespace ContextMenuToShowTopN_Example
8483
End Sub)
8584
valueItem.PivotGrid.EndUpdate()
8685
End Sub
87-
Private Shared Function IsTopFiveValuesApplied(ByVal valueItem As FieldValueItem) As Boolean
86+
Private Shared Function IsTopFiveValuesApplied(ByVal valueItem As FieldValueElementData) As Boolean
8887
Dim fields = valueItem.PivotGrid.GetFieldsByArea(If(valueItem.IsColumn, FieldArea.RowArea, FieldArea.ColumnArea))
8988
If fields.Count = 0 Then
9089
Return False
@@ -116,9 +115,9 @@ Namespace ContextMenuToShowTopN_Example
116115
Next f
117116
pivotGrid.EndUpdate()
118117
End Sub
119-
Private Shared Function GetConditions(ByVal valueItem As FieldValueItem) As List(Of KeyValuePair(Of PivotGridField, Object))
118+
Private Shared Function GetConditions(ByVal valueItem As FieldValueElementData) As List(Of KeyValuePair(Of PivotGridField, Object))
120119
Dim fields = valueItem.PivotGrid.GetFieldsByArea(If(valueItem.IsColumn, FieldArea.ColumnArea, FieldArea.RowArea)).Where(Function(f) f.AreaIndex <= valueItem.Field.AreaIndex)
121-
Return fields.Select(Function(f) New KeyValuePair(Of PivotGridField, Object)(f, valueItem.PivotGrid.GetFieldValue(f, valueItem.MinLastLevelIndex))).ToList()
120+
Return fields.Select(Function(f) New KeyValuePair(Of PivotGridField, Object)(f, valueItem.PivotGrid.GetFieldValue(f, valueItem.MinIndex))).ToList()
122121
End Function
123122

124123
Private Sub PivotGridControl1_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)

0 commit comments

Comments
 (0)