mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-23 04:46:16 -04:00
Replace the hand-composed vector layers with the shared rendering bound through EntryStatus.ButtonImage, and delete the geometry and stoplight brushes that only that composition used. The rendering is per-theme rather than a set of DynamicResource brushes, so each button re-renders its icon when the actual theme variant changes. Co-authored-by: rmcrackan <rmcrackan@gmail.com>
34 lines
1.3 KiB
XML
34 lines
1.3 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"
|
|
xmlns:vm="clr-namespace:LibationAvalonia.ViewModels"
|
|
mc:Ignorable="d" d:DesignWidth="200" d:DesignHeight="200" MinWidth="37" MinHeight="40"
|
|
Background="Transparent"
|
|
x:DataType="vm:LiberateStatusButtonViewModel"
|
|
x:Class="LibationAvalonia.Views.LiberateStatusButton">
|
|
|
|
<UserControl.Styles>
|
|
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter">
|
|
<Setter Property="Background" Value="{DynamicResource SystemChromeDisabledLowColor}" />
|
|
<Setter Property="BorderBrush" Value="{DynamicResource SystemChromeDisabledLowColor}" />
|
|
</Style>
|
|
</UserControl.Styles>
|
|
|
|
<Button
|
|
Name="button"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
Padding="0"
|
|
IsEnabled="{Binding IsButtonEnabled}" Click="Button_Click" >
|
|
|
|
<Grid RowDefinitions="*,8*,*">
|
|
<Image
|
|
Grid.Row="1"
|
|
Stretch="Uniform"
|
|
RenderOptions.BitmapInterpolationMode="HighQuality"
|
|
Source="{Binding ButtonImage}" />
|
|
</Grid>
|
|
</Button>
|
|
</UserControl>
|