29 lines
1.5 KiB
XML
29 lines
1.5 KiB
XML
<UserControl x:Class="CtrEditor.ObjetosSim.UserControls.BrushEditor"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="clr-namespace:CtrEditor.ObjetosSim.UserControls"
|
|
x:Name="brushEditorControl">
|
|
|
|
<ComboBox x:Name="colorComboBox"
|
|
SelectedValuePath="Color"
|
|
MinWidth="200"
|
|
SelectedValue="{Binding Path=Value, ElementName=brushEditorControl, Mode=TwoWay}">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Rectangle Width="16" Height="16" Fill="{Binding Color}" Margin="0,0,5,0"/>
|
|
<TextBlock Text="{Binding Name}" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
<ComboBox.ItemsSource>
|
|
<x:Array Type="{x:Type local:ColorItem}">
|
|
<local:ColorItem Name="Rojo" Color="{x:Static Brushes.Red}" />
|
|
<local:ColorItem Name="Azul" Color="{x:Static Brushes.Blue}" />
|
|
<local:ColorItem Name="Negro" Color="{x:Static Brushes.Black}" />
|
|
<local:ColorItem Name="Verde" Color="{x:Static Brushes.Green}" />
|
|
<local:ColorItem Name="Gris" Color="{x:Static Brushes.Gray}" />
|
|
</x:Array>
|
|
</ComboBox.ItemsSource>
|
|
</ComboBox>
|
|
</UserControl> |