/
MainWindow.xaml
64 lines (63 loc) · 3.77 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<Window xmlns:dxpg="http://schemas.devexpress.com/winfx/2008/xaml/pivotgrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:local="clr-namespace:HowtoObtainUnderlyingData"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
x:Class="HowtoObtainUnderlyingData.MainWindow"
Title="MainWindow" Height="419" Width="776"
DataContext="{dxmvvm:ViewModelSource Type=local:ViewModel}">
<dxmvvm:Interaction.Behaviors>
<dx:DialogService Name="DrillDownTemplate">
<dx:DialogService.DialogStyle>
<Style TargetType="dx:DXDialogWindow">
<Setter Property="Height" Value="400" />
<Setter Property="Width" Value="600" />
<Setter Property="ShowIcon" Value="False" />
<Setter Property="ShowInTaskbar" Value="False" />
<Setter Property="WindowStyle" Value="ToolWindow" />
</Style>
</dx:DialogService.DialogStyle>
<dx:DialogService.ViewTemplate>
<DataTemplate>
<dxg:GridControl ItemsSource="{Binding DrillDownDataSource}">
<dxg:GridControl.Columns>
<dxg:GridColumn FieldName="OrderID" />
<dxg:GridColumn FieldName="OrderDate"/>
<dxg:GridColumn FieldName="ProductName"/>
<dxg:GridColumn FieldName="Extended Price" Header="Price" />
</dxg:GridControl.Columns>
</dxg:GridControl>
</DataTemplate>
</dx:DialogService.ViewTemplate>
</dx:DialogService>
</dxmvvm:Interaction.Behaviors>
<Grid>
<dxpg:PivotGridControl DataSource="{Binding DataSource}" x:Name="pivot">
<dxpg:PivotGridControl.InputBindings>
<KeyBinding Command="{Binding ShowDrillDownDataCommand}" CommandParameter="{Binding SelectedCellInfo, ElementName=pivot}" Key="Enter"/>
</dxpg:PivotGridControl.InputBindings>
<dxmvvm:Interaction.Triggers>
<dxmvvm:EventToCommand PassEventArgsToCommand="True" Command="{Binding ShowDrillDownDataCommand}" EventName="MouseDoubleClick">
<dxmvvm:EventToCommand.EventArgsConverter>
<dxpg:EventArgsToCellInfoConverter />
</dxmvvm:EventToCommand.EventArgsConverter>
</dxmvvm:EventToCommand>
</dxmvvm:Interaction.Triggers>
<dxpg:PivotGridControl.Fields>
<dxpg:PivotGridField Name="fieldCountry" FieldName="Country" Area="RowArea" />
<dxpg:PivotGridField Name="fieldCustomer" FieldName="Sales Person" Area="RowArea"
Caption="Customer" />
<dxpg:PivotGridField Name="fieldYear" FieldName="OrderDate" Area="ColumnArea"
Caption="Year" GroupInterval="DateYear" />
<dxpg:PivotGridField Name="fieldCategoryName" FieldName="CategoryName"
Area="ColumnArea" Caption="Product Category" />
<dxpg:PivotGridField Name="fieldProductName" FieldName="ProductName"
Area="FilterArea" Caption="Product Name" />
<dxpg:PivotGridField Name="fieldExtendedPrice" FieldName="Extended Price"
Area="DataArea" CellFormat="c0" />
</dxpg:PivotGridControl.Fields>
</dxpg:PivotGridControl>
</Grid>
</Window>