/
Window.xaml
49 lines (49 loc) · 2.73 KB
/
Window.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
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Sample"
xmlns:dxgn="http://schemas.devexpress.com/winfx/2008/xaml/gantt"
xmlns:dxdash="http://schemas.devexpress.com/winfx/2008/xaml/dashboard"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
DataContext="{dxmvvm:ViewModelSource Type=local:GanttViewModel}"
x:Class="Sample.Window"
mc:Ignorable="d"
Title="Window" Height="500" Width="800">
<Window.Resources>
<Style x:Key="ganttStyle" TargetType="dxdash:GridDashboardLayoutItem">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dxgn:GanttControl ItemsSource="{Binding GanttTasks}" DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window}}" >
<dxgn:GanttControl.View>
<dxgn:GanttView
AutoExpandAllNodes="True"
TreeDerivationMode="Selfreference"
KeyFieldName="Id"
ParentFieldName="ParentId"
StartDateMapping="Start"
FinishDateMapping="Finish"
NameMapping="Name" />
</dxgn:GanttControl.View>
<dxgn:GanttColumn FieldName="Name"/>
<dxgn:GanttColumn FieldName="Start"/>
<dxgn:GanttColumn FieldName="Finish"/>
<dxmvvm:Interaction.Behaviors>
<dxmvvm:EventToCommand EventName="SizeChanged" Command="{Binding OnSizeChangedCommand}" PassEventArgsToCommand="True"></dxmvvm:EventToCommand>
</dxmvvm:Interaction.Behaviors>
</dxgn:GanttControl>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<local:GanttStyleSelector x:Key="ganttStyleSelector" GanttStyle="{StaticResource ganttStyle}"/>
</Window.Resources>
<Grid>
<dxdash:DashboardControl DashboardSource="{x:Type local:Dashboard}"
ObjectDataSourceLoadingBehavior="LoadAsIs"
GridItemStyleSelector="{StaticResource ganttStyleSelector}">
</dxdash:DashboardControl>
</Grid>
</Window>