mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 01:58:30 +00:00
69 lines
3.5 KiB
XML
69 lines
3.5 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" />
|
|
|
|
<ControlTemplate x:Key="ControlTemplateLedRectangle"
|
|
TargetType="{x:Type controls:LedVisualizer}">
|
|
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
|
<Border.Background>
|
|
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
|
Stretch="Fill"
|
|
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</Border.Background>
|
|
|
|
<Rectangle VerticalAlignment="Stretch"
|
|
HorizontalAlignment="Stretch"
|
|
Opacity="0.5"
|
|
Stroke="{TemplateBinding BorderBrush}"
|
|
StrokeThickness="1"
|
|
Fill="{TemplateBinding Background}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate x:Key="ControlTemplateLedCircle"
|
|
TargetType="{x:Type controls:LedVisualizer}">
|
|
<Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
|
<Border.Background>
|
|
<ImageBrush AlignmentX="Center" AlignmentY="Center"
|
|
Stretch="Fill"
|
|
ImageSource="{Binding Led.Image, RelativeSource={RelativeSource TemplatedParent}}" />
|
|
</Border.Background>
|
|
|
|
<Ellipse VerticalAlignment="Stretch"
|
|
HorizontalAlignment="Stretch"
|
|
Opacity="0.5"
|
|
Stroke="{TemplateBinding BorderBrush}"
|
|
StrokeThickness="1"
|
|
Fill="{TemplateBinding Background}" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
<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="BorderBrush" Value="#A8202020" />
|
|
<Setter Property="Background" Value="{Binding Led.Color, RelativeSource={RelativeSource Self},
|
|
Converter={StaticResource ConverterColorToSolidColorBrush}}" />
|
|
|
|
<Setter Property="Template" Value="{StaticResource ControlTemplateLedRectangle}" />
|
|
|
|
<Style.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="BorderBrush" Value="#A8FFFFFF" />
|
|
</Trigger>
|
|
|
|
<DataTrigger Binding="{Binding Led.Shape, RelativeSource={RelativeSource Self}}" Value="Circle">
|
|
<Setter Property="Template" Value="{StaticResource ControlTemplateLedCircle}" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<Style TargetType="{x:Type controls:LedVisualizer}" BasedOn="{StaticResource StyleLedVisualizer}" />
|
|
|
|
</ResourceDictionary> |