<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:RGB.NET.WPF.Controls">

    <Style x:Key="StyleRGBDeviceVisualizer"
           TargetType="{x:Type controls:RGBDeviceVisualizer}">
        <Setter Property="Width" Value="{Binding Device.Size.Width, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Height" Value="{Binding Device.Size.Height, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Canvas.Left" Value="{Binding Device.Location.X, RelativeSource={RelativeSource Self}}" />
        <Setter Property="Canvas.Top" Value="{Binding Device.Location.Y, RelativeSource={RelativeSource Self}}" />

        <Setter Property="BorderThickness" Value="2" />
        <Setter Property="BorderBrush" Value="#202020" />
        <!--<Setter Property="Background" Value="#3A3A3A" />-->
        <Setter Property="Background">
            <Setter.Value>
                <ImageBrush AlignmentX="Left" AlignmentY="Top"
                            Stretch="Uniform"
                            ImageSource="{Binding Device.DeviceInfo.Image, RelativeSource={RelativeSource AncestorType=controls:RGBDeviceVisualizer}}" />
            </Setter.Value>
        </Setter>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:RGBDeviceVisualizer}">
                    <Grid VerticalAlignment="Stretch"
                          HorizontalAlignment="Stretch" 
                          Background="{TemplateBinding Background}">
                        <Canvas x:Name="PART_Canvas" 
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch" />

                        <Border VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                Background="{x:Null}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type controls:RGBDeviceVisualizer}" BasedOn="{StaticResource StyleRGBDeviceVisualizer}" />

</ResourceDictionary>