-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
76 lines (76 loc) · 4.47 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
65
66
67
68
69
70
71
72
73
74
75
76
<dx:ThemedWindow x:Class="AppearanceCustomization.MainWindow"
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:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxa="http://schemas.devexpress.com/winfx/2008/xaml/accordion"
xmlns:dxat="http://schemas.devexpress.com/winfx/2008/xaml/accordion/themekeys"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
dx:ThemeManager.ThemeName="Office2019Colorful"
xmlns:local="clr-namespace:AppearanceCustomization"
mc:Ignorable="d"
Title="Appearance Customization"
DataContext="{dxmvvm:ViewModelSource Type=local:MainViewModel}"
Height="450" Width="800">
<dx:ThemedWindow.Resources>
<Style TargetType="dxa:AccordionControl">
<Setter Property="Background" Value="#fdfdfd"/>
<Setter Property="BorderBrush" Value="#51555f"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>
</dx:ThemedWindow.Resources>
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{DXBinding '@e(accordion).IsExpanded ? 200 : `Auto`'}"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<dxa:AccordionControl x:Name="accordion"
ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem}"
ChildrenPath="Nodes" DisplayMemberPath="Header"
IsCollapseButtonVisible="True"
HeaderContent="Header"
AutoExpandAllItems="True"
ExpandItemOnHeaderClick="False"
CollapsedItemClickAction="Select" Margin="0,0,10,0">
<dxa:AccordionControl.HeaderStyle>
<Style TargetType="dxa:HeaderPresenter" >
<Setter Property="Background" Value="#e6f2fa"/>
<Setter Property="Foreground" Value="Brown"/>
<Setter Property="BorderBrush" Value="#51555f"/>
<Setter Property="BorderThickness" Value="0,0,0,1"/>
</Style>
</dxa:AccordionControl.HeaderStyle>
<dxa:AccordionControl.ItemContainerStyle>
<Style TargetType="dxa:AccordionItem">
<Setter Property="Foreground" Value="Red"/>
<Setter Property="ShowInCollapsedMode" Value="{Binding ShowInCollapsedMode}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsCustomView}" Value="True">
<Setter Property="Background" Value="#e6f2fa" />
<Setter Property="BorderBrush" Value="#0072c6"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="Orange"/>
</DataTrigger>
</Style.Triggers>
</Style>
</dxa:AccordionControl.ItemContainerStyle>
</dxa:AccordionControl>
<Grid Grid.Column="1" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Margin="0,0,0,10" HorizontalAlignment="Left" VerticalAlignment="Bottom"
Text="{DXBinding '`SelectedItem: ` + SelectedItem.Header'}"/>
<Button Grid.Row="1" Height="30" Content="Update custom items" Command="{Binding UpdateCustomItemsCommand}"/>
<ToggleButton Grid.Row="1" Grid.Column="1" Height="30" Margin="10,0,0,0" Content="{DXBinding '@s.IsChecked ? `Expand accordion` : `Collapse accordion`'}"
IsChecked="{DXBinding '@e(accordion).IsExpanded', Converter={dxmvvm:BooleanNegationConverter}}"/>
</Grid>
</Grid>
</dx:ThemedWindow>