Mesen2/UI/Controls/StateGridEntry.axaml
2023-01-25 16:03:56 -05:00

61 lines
No EOL
2 KiB
XML

<UserControl
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="100" d:DesignHeight="100"
xmlns:c="using:Mesen.Controls"
x:Name="root"
HorizontalAlignment="Stretch"
x:Class="Mesen.Controls.StateGridEntry"
>
<UserControl.Resources>
<Color x:Key="ButtonBorderBrushDisabled">Gray</Color>
<Color x:Key="ButtonBorderBrushPointerOver">#00C0FF</Color>
</UserControl.Resources>
<UserControl.Styles>
<Style Selector="TextBlock">
<Setter Property="Foreground" Value="White" />
</Style>
<Style Selector="TextBlock:disabled">
<Setter Property="Foreground" Value="Gray" />
</Style>
<Style Selector="Button">
<Setter Property="BorderBrush" Value="SlateGray" />
</Style>
<Style Selector="Button.activeEntry">
<Setter Property="BorderBrush" Value="#0078D7" />
</Style>
</UserControl.Styles>
<DockPanel Margin="2 2 2 7">
<TextBlock
DockPanel.Dock="Bottom"
Text="{CompiledBinding SubTitle, ElementName=root}"
TextAlignment="Center"
TextWrapping="Wrap"
IsEnabled="{CompiledBinding Enabled, ElementName=root}"
/>
<TextBlock
DockPanel.Dock="Bottom"
Text="{CompiledBinding Title, ElementName=root}"
TextAlignment="Center"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis"
IsEnabled="{CompiledBinding Enabled, ElementName=root}"
/>
<Button
Classes.activeEntry="{CompiledBinding IsActiveEntry, ElementName=root}"
BorderThickness="2"
Height="NaN"
Background="Transparent"
Click="OnImageClick"
IsEnabled="{CompiledBinding Enabled, ElementName=root}"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
Padding="0"
>
<Image Source="{CompiledBinding Image, ElementName=root}" Stretch="Uniform" StretchDirection="Both" VerticalAlignment="Center" />
</Button>
</DockPanel>
</UserControl>