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/LedVisualizer.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

41 lines
2.2 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"
xmlns:converter="clr-namespace:RGB.NET.WPF.Converter">
<converter:ColorToSolidColorBrushConverter x:Key="ConverterColorToSolidColorBrush" />
<Style x:Key="StyleLedVisualizer"
TargetType="{x:Type controls:LedVisualizer}">
<Setter Property="Width" Value="{Binding Led.LedRectangle.Size.Width, RelativeSource={RelativeSource Self}}" />
<Setter Property="Height" Value="{Binding Led.LedRectangle.Size.Height, RelativeSource={RelativeSource Self}}" />
<Setter Property="Canvas.Left" Value="{Binding Led.LedRectangle.Location.X, RelativeSource={RelativeSource Self}}" />
<Setter Property="Canvas.Top" Value="{Binding Led.LedRectangle.Location.Y, RelativeSource={RelativeSource Self}}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="#202020" />
<Setter Property="Background" Value="{Binding Led.Color, RelativeSource={RelativeSource Self},
Converter={StaticResource ConverterColorToSolidColorBrush}}" />
<Setter Property="Opacity" Value="0.66" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:LedVisualizer}">
<Rectangle VerticalAlignment="Stretch"
HorizontalAlignment="Stretch"
Stroke="{TemplateBinding BorderBrush}"
StrokeThickness="{TemplateBinding BorderThickness}"
Fill="{TemplateBinding Background}" />
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="#FFFFFF" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type controls:LedVisualizer}" BasedOn="{StaticResource StyleLedVisualizer}" />
</ResourceDictionary>