/
MainWindow.xaml
57 lines (45 loc) · 3.08 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
<dx:DXWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
x:Class="DevExpress.Examples.ThemeSwitcher.MainWindow"
xmlns:dxut="clr-namespace:DevExpress.Xpf.Utils.Themes;assembly=DevExpress.Xpf.Core.v22.2"
x:Name="wndMain"
Title="MainWindow" Height="550" Width="850">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Application theme:" VerticalAlignment="Center" Margin="10,0" />
<dxe:ComboBoxEdit VerticalAlignment="Center" Width="200" ItemsSource="{Binding Source={x:Static dx:Theme.Themes}}" x:Name="cbTheme"
DisplayMember="Name" ValueMember="Name" EditValueChanged="cbTheme_EditValueChanged" />
<Button Content="Set default theme" VerticalAlignment="Center" Margin="10,0" Padding="15,1" Click="Button_Click" />
</StackPanel>
<dxg:GridControl Grid.Row="1" AutoGenerateColumns="AddNew" x:Name="dxGrid" EnableSmartColumnsGeneration="True">
<dxg:GridControl.View>
<dxg:TableView AllowPerPixelScrolling="True" ShowTotalSummary="True" />
</dxg:GridControl.View>
</dxg:GridControl>
<dx:BackgroundPanel Grid.Row="2"
dx:ThemeManager.ThemeName="{Binding EditValue, ElementName=cbLocalTheme}">
<GroupBox Header="Set a theme for this element:" Height="Auto">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Local theme:" VerticalAlignment="Center" Margin="10,0" />
<dxe:ComboBoxEdit VerticalAlignment="Center" Width="200" x:Name="cbLocalTheme" SelectedIndex="15" ValueMember="Name"
ItemsSource="{Binding Source={x:Static dx:Theme.Themes}}" />
<dxe:CheckEdit Content="DXCheckEdit" Margin="10,0" />
<!--This text edit has it's own background-->
<dxe:TextEdit Text="I'm always red" x:Name="tbSpecial" Background="OrangeRed" Margin="10,0" />
<!--This button's theme is set directly-->
<Button Content="Independent theme" dx:ThemeManager.ThemeName="MetropolisDark" Margin="10,0" />
<Slider Value="40" Width="200" Maximum="100" Margin="10,0" />
</StackPanel>
</GroupBox>
</dx:BackgroundPanel>
</Grid>
</dx:DXWindow>