12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:Compdfkit_Tools.Asset.Styles">
- <Style x:Key="TCIRadioButtonStyle" TargetType="RadioButton">
- <Setter Property="Background" Value="Red"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:TCIRadioButton}">
- <Grid HorizontalAlignment="Left">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="40"></ColumnDefinition>
- <ColumnDefinition Width="auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Grid Grid.RowSpan="2">
- <Ellipse x:Name="RadioEllipse"
- Width="20"
- Height="20"
- Fill="White"
- Stroke="{TemplateBinding BorderBrush}"
- StrokeThickness="1"/>
- <Ellipse x:Name="InnerEllipse"
- Width="15"
- Height="15"
- Fill="Black"
- Opacity="0"/>
- </Grid>
- <Border x:Name="Border" BorderBrush="#1A000000" BorderThickness="1" Grid.Column="1" CornerRadius="1" Padding="10" HorizontalAlignment="Stretch" Background="Transparent">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <!-- 这里是 ContentPresenter -->
- <Grid x:Name="PART_IconGrid" Width="32" Margin="0,0,10,0">
- <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
- </Grid>
- <Grid Name="TextGd" Grid.Column="1" Width="{TemplateBinding TextWidth}" VerticalAlignment="Center">
- <Grid.RowDefinitions>
- <RowDefinition Height="25"></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <TextBlock Text="{TemplateBinding Title}" TextWrapping="Wrap" FontSize="14" FontWeight="Bold" FontFamily="Segoe UI"></TextBlock>
- <TextBlock Grid.Row="1" Text="{TemplateBinding Description}" TextWrapping="Wrap" FontSize="12" FontWeight="Normal" FontFamily="Segoe UI"></TextBlock>
- </Grid>
- </Grid>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="InnerEllipse" Property="Opacity" Value="1"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="RadioEllipse" Property="Stroke" Value="DodgerBlue"/>
- <Setter TargetName="InnerEllipse" Property="Stroke" Value="DodgerBlue"/>
- <Setter TargetName="Border" Property="Background" Value="AliceBlue"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|