Mini Kabibi Habibi
<local:EditorsDemoModule x:Class="EditorsDemo.ColorEditModule"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EditorsDemo"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:utils="clr-namespace:EditorsDemo.Utils"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxdb="http://schemas.devexpress.com/winfx/2008/xaml/demobase"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors">
<local:EditorsDemoModule.Resources>
<ResourceDictionary>
<dx:ColorToBrushConverter x:Key="ColorToBrushConverter" />
<local:PaletteCollectionConverter x:Key="PaletteCollectionConverter" />
<Style x:Key="paletteColorsStyle" TargetType="ListBox">
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListBoxItem">
<Setter Property="Margin" Value="1,0,1,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" Width="12" Height="12" Stroke="Gray" StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</local:EditorsDemoModule.Resources>
<dxdb:DemoModuleControl>
<dxdb:DemoModuleControl.OptionsContent>
<StackPanel MinWidth="200">
<dx:GroupFrame Header="Properties">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<dxe:CheckEdit x:Name="chkReset" Content="Show "Automatic" button" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,0,0,4" IsChecked="True" />
<dxe:CheckEdit x:Name="chkNoColor" Content="Show "No Color" button" Grid.Row="1" Grid.ColumnSpan="2" Margin="0,0,0,4" IsChecked="False" />
<dxe:CheckEdit x:Name="chkMoreColors" Content="Show "More Colors" button" Grid.Row="2" Grid.ColumnSpan="2" Margin="0,0,0,8" IsChecked="True" />
<TextBlock Grid.Row="3" Grid.Column="0" Text="Chip size:" VerticalAlignment="Center" Margin="0,0,6,4" />
<dxe:ComboBoxEdit x:Name="chkChipSize" Grid.Row="3" Grid.Column="1" IsTextEditable="False" Margin="0,0,0,4" SelectedIndex="0" />
</Grid>
</dx:GroupFrame>
</StackPanel>
</dxdb:DemoModuleControl.OptionsContent>
<Grid>
<local:PaintControl ShowAutomaticButton="{Binding ElementName=chkReset, Path=IsChecked, Mode=OneWay}"
ShowMoreColorsButton="{Binding ElementName=chkMoreColors, Path=IsChecked, Mode=OneWay}"
ShowNoColorButton="{Binding ElementName=chkNoColor, Path=IsChecked, Mode=OneWay}"
ChipSize="{Binding ElementName=chkChipSize, Path=EditValue, Mode=OneWay}"
/>
</Grid>
</dxdb:DemoModuleControl>
</local:EditorsDemoModule>