123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:customControl="clr-namespace:PDF_Master.CustomControl">
- <Style TargetType="{x:Type customControl:ImageRadioButton}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type customControl:ImageRadioButton}">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <Grid x:Name="grid" Background="{TemplateBinding Background}">
- <Border
- x:Name="PART_Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{TemplateBinding CornerRadius}" />
- <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
- <StackPanel
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="{TemplateBinding IconContentOrientation}">
- <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
- <Image
- x:Name="PART_Icon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Source="{TemplateBinding Icon}" />
- <Image
- x:Name="PART_MouseOverIcon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Source="{TemplateBinding IconMouseOver}"
- Visibility="Collapsed" />
- <Image
- x:Name="PART_PressIcon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Source="{TemplateBinding IconPress}"
- Visibility="Collapsed" />
- <Image
- x:Name="PART_CheckedIcon"
- Width="{TemplateBinding IconWidth}"
- Height="{TemplateBinding IconHeight}"
- Source="{TemplateBinding IconChecked}"
- Visibility="Collapsed" />
- </Grid>
- <TextBlock
- x:Name="PART_Content"
- Margin="{TemplateBinding IconContentMargin}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Foreground="{TemplateBinding Foreground}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- Text="{TemplateBinding Content}"
- TextTrimming="CharacterEllipsis" />
- </StackPanel>
- </Grid>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Opacity" Value="0.5" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
- <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
- <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Visible" />
- </Trigger>
- <Trigger SourceName="PART_Content" Property="Text" Value="">
- <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
- </Trigger>
- <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
- <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|