/
MainWindow.xaml
43 lines (41 loc) · 2.49 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
<dx:ThemedWindow 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:DataGridBackground"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
DataContext="{dxmvvm:ViewModelSource Type={x:Type local:MainViewModel}}"
x:Class="DataGridBackground.MainWindow"
dx:DXSerializer.Enabled="True"
WindowKind="Ribbon"
mc:Ignorable="d"
dx:DXSerializer.StoreLayoutMode="All"
Height="530"
Width="725">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="200"/>
</Grid.ColumnDefinitions>
<dxg:GridControl Grid.Column="0"
Background="{Binding SelectedColor, Converter={dxmvvm:ColorToBrushConverter}}"
DataAreaBackground="{Binding DataAreaSelectedColor, Converter={dxmvvm:ColorToBrushConverter}}"
ItemsSource="{Binding Items}"
AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView EnableSelectedRowAppearance="False"/>
</dxg:GridControl.View>
</dxg:GridControl>
<StackPanel VerticalAlignment="Top" Grid.Column="1" Margin="10">
<TextBlock Margin="2" Text="Grid Background"/>
<dxe:ColorEdit x:Name="colorEdit2" ShowDefaultColorButton="False" ShowNoColorButton="True"
EditValue="{Binding Path=SelectedColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<TextBlock Margin="2,20,2,2" Text="Data Area Background"/>
<dxe:ColorEdit x:Name="colorEdit3" ShowDefaultColorButton="False" ShowNoColorButton="True"
EditValue="{Binding Path=DataAreaSelectedColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
</Grid>
</dx:ThemedWindow>