Files
parsec-vdd/app/Components/Button.xaml
T
2025-03-11 09:26:30 +07:00

50 lines
2.2 KiB
XML

<UserControl
x:Class="ParsecVDisplay.Components.Button"
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:ParsecVDisplay.Components"
mc:Ignorable="d"
d:DesignHeight="40" d:DesignWidth="120"
>
<UserControl.Style>
<Style TargetType="{x:Type UserControl}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="True">
<Setter Property="Opacity" Value="1"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Style>
<Button Foreground="White" Click="Button_Click">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="#1FFF" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" BorderThickness="1" BorderBrush="#6FFF" CornerRadius="{DynamicResource ButtonCornerRadius}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#2FFF"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#4FFF"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<ContentPresenter Content="{Binding Content}" />
</Button>
</UserControl>