1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 01:58:30 +00:00
RGB.NET/RGB.NET.WPF/Styles/RGBDeviceVisualizer.xaml
Darth Affe dcaebd2b3b Added first working version of a WPF-RGBSurface
(needs tons of work though, performance is bad and it doesn't look too good so far)
2017-01-29 20:14:57 +01:00

46 lines
2.4 KiB
XML

<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>