This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
/
MainWindow.xaml
53 lines (50 loc) · 2.75 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
<Window x:Class="SchedulerCustomizeResourcesControlsWpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxsch="http://schemas.devexpress.com/winfx/2008/xaml/scheduler"
xmlns:local="clr-namespace:SchedulerCustomizeResourcesControlsWpf"
Title="MainWindow" Height="400" Width="500">
<Window.Resources>
<DataTemplate x:Key="ResourceDataTemplate">
<StackPanel Orientation="Horizontal">
<Ellipse Fill="{Binding Id, Converter={local:ResourceColorConverter}}" Width="15" Height="15"/>
<Border Margin="3" BorderThickness="1" BorderBrush="SteelBlue" CornerRadius="4">
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} ({1})">
<Binding Path="Id.Caption"/>
<Binding Path="Id.Id"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</Border>
</StackPanel>
</DataTemplate>
<DataTemplate x:Key="ResourcesPopupDataTemplate">
<StackPanel Orientation="Horizontal">
<Border Margin="3" BorderThickness="1" BorderBrush="SteelBlue" CornerRadius="4">
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} ({1})">
<Binding Path="Caption"/>
<Binding Path="Id"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</Border>
</StackPanel>
</DataTemplate>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<dxsch:ResourcesComboBoxControl Grid.Row="0" SchedulerControl="{Binding ElementName=scheduler}" ShowAllResourcesItem="False" ShowNoneResourcesItem="False" ItemTemplate="{StaticResource ResourceDataTemplate}" />
<dxsch:ResourcesPopupCheckedListBoxControl Grid.Row="1" SchedulerControl="{Binding ElementName=scheduler}" ItemTemplate="{StaticResource ResourcesPopupDataTemplate}" />
<dxsch:ResourcesCheckedListBoxControl Grid.Row="2" SchedulerControl="{Binding ElementName=scheduler}" MinHeight="20" ItemTemplate="{StaticResource ResourceDataTemplate}" />
<dxsch:SchedulerControl x:Name="scheduler" Grid.Row="3" GroupType="Resource"/>
</Grid>
</Window>