<UserControl x:Class="StructureHelper.Windows.UserControls.PrimitiveVisualProperty"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:StructureHelper.Windows.UserControls"
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="400">
    <Grid DataContext="{Binding ObjectVisual, RelativeSource={RelativeSource AncestorType=local:PrimitiveVisualProperty}}">
        <Grid.RowDefinitions>
            <RowDefinition Height="22"/>
            <RowDefinition Height="22"/>
            <RowDefinition Height="22"/>
            <RowDefinition Height="30"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Text="Visible"/>
        <TextBlock Grid.Row="1" Text="Color"/>
        <TextBlock Grid.Row="2" Text="Z-index (integer)"/>
        <TextBlock Grid.Row="3" Text="Opacity"/>
        <CheckBox Grid.Column="1" IsChecked="{Binding IsVisible}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="1,0,0,0"/>
        <Grid Grid.Column="1" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="50"/>
            </Grid.ColumnDefinitions>
            <Rectangle Margin="1" Stroke="Black">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{Binding Color}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Button Grid.Column="1" Margin="1" Content="..." Command="{Binding EditColorCommand}"/>
        </Grid>
        <TextBox Grid.Row="2" Grid.Column="1" Margin="1" Text="{Binding ZIndex}"/>
        <Grid Grid.Row="3" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBox Text="{Binding FactoredOpacity, Converter={StaticResource PlainDouble}, ValidatesOnExceptions=True}" Margin="1,2,3,4"/>
            <Slider Grid.Column="1" Value="{Binding FactoredOpacity}" Maximum="100" TickPlacement="BottomRight" TickFrequency="10" IsSnapToTickEnabled="True" Margin="2"/>
        </Grid>
    </Grid>
</UserControl>
