12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <Styles xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:components="using:InABox.Avalonia.Components"
- xmlns:converters="using:InABox.Avalonia.Converters">
- <Style Selector="components|ListViewButton">
- <Style.Resources>
- <converters:DoubleToCornerRadiusConverter
- x:Key="SphericalBorder"
- Ratio="0.5" />
- <converters:DoubleToThicknessConverter
- x:Key="MarginDoubler"
- Ratio="2.0" />
- </Style.Resources>
- <Setter Property="Template">
- <ControlTemplate>
- <Button Height="80"
- Padding="0"
- Background="{TemplateBinding Background}"
- Foreground="{TemplateBinding Foreground}"
- BorderBrush="{StaticResource PrsTileBorder}"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- Command="{TemplateBinding Command}"
- CommandParameter="{TemplateBinding CommandParameter}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="1.2*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="70" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image
- Classes="Large"
- Grid.Row="0"
- Grid.Column="0"
- Grid.RowSpan="2"
- Source="{TemplateBinding Image}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center" />
- <Label
- Grid.Row="0"
- Grid.Column="1"
- VerticalAlignment="Stretch"
- VerticalContentAlignment="Center"
- FontSize="{StaticResource PrsFontSizeLarge}"
- FontWeight="{StaticResource PrsFontWeightBold}"
- Content="{TemplateBinding Title}" />
- <TextBlock
- Grid.Row="1"
- Grid.Column="1"
- FontSize="{StaticResource PrsFontSizeNormal}"
- FontStyle="{StaticResource PrsFontStylItalic}"
- TextWrapping="WrapWithOverflow"
- VerticalAlignment="Stretch"
- Text="{TemplateBinding Description}" />
- <Border
- Background="{StaticResource PrsTileBackground}"
- BorderBrush="{StaticResource PrsTileBorder}"
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.Column="1"
- VerticalAlignment="Top"
- HorizontalAlignment="Right"
- IsVisible="{TemplateBinding Alert, Converter={StaticResource StringToBooleanConverter}}"
- MinWidth="{Binding $self.Bounds.Height}"
- Margin="{Binding $self, Converter={StaticResource MarginDoubler}, ConverterParameter={StaticResource PrsControlSpacing}}"
- CornerRadius="{Binding $self.Bounds.Height, Converter={StaticResource SphericalBorder}}">
- <Label
- Background="Transparent"
- Foreground="{StaticResource PrsTileForeground}"
- HorizontalContentAlignment="Center"
- Content="{TemplateBinding Alert}" />
- </Border>
- </Grid>
- </Button>
- </ControlTemplate>
- </Setter>
- </Style>
- </Styles>
|