RadioButtonStyles.xaml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <ResourceDictionary.MergedDictionaries>
  4. <ResourceDictionary Source="/Resources/Common/TextBlocks.xaml"/>
  5. </ResourceDictionary.MergedDictionaries>
  6. <Style x:Key="FormRadios" TargetType="RadioButton">
  7. <Setter Property="FontSize" Value="14"></Setter>
  8. <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
  9. </Style>
  10. <Style x:Key="FormBorderStyle" TargetType="Border">
  11. <Setter Property="Margin" Value="0 5 0 0"></Setter>
  12. <Setter Property="Padding" Value="5"></Setter>
  13. <Setter Property="CornerRadius" Value="5"></Setter>
  14. <Setter Property="BorderBrush" Value="Gray"></Setter>
  15. <Setter Property="BorderThickness" Value="1"></Setter>
  16. </Style>
  17. <ControlTemplate x:Key="RadioButtonNumberOfPage" TargetType="RadioButton">
  18. <Grid Width="Auto" Margin="12,0" Background="#00000000" Cursor="Hand">
  19. <VisualStateManager.VisualStateGroups>
  20. <VisualStateGroup x:Name="CheckStates">
  21. <VisualState x:Name="Checked">
  22. <Storyboard>
  23. <DoubleAnimation Storyboard.TargetName="SelectedText" Storyboard.TargetProperty="(UIElement.Opacity)"
  24. Duration="0:0:0.100" To="1"/>
  25. <DoubleAnimation Storyboard.TargetName="OriginalText" Storyboard.TargetProperty="(UIElement.Opacity)"
  26. Duration="0:0:0.100" To="0"/>
  27. </Storyboard>
  28. </VisualState>
  29. <VisualState x:Name="Unchecked"/>
  30. </VisualStateGroup>
  31. </VisualStateManager.VisualStateGroups>
  32. <ContentPresenter Name="Container" Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Collapsed"/>
  33. <TextBlock Name="OriginalText" Style="{StaticResource NumberOfPageText}" Text="{Binding Content, ElementName=Container}" Visibility="Visible" Opacity="1" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  34. <TextBlock Name="SelectedText" Style="{StaticResource NumberOfSelectedPageText}" Text="{Binding Content, ElementName=Container}" Visibility="Visible" Opacity="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  35. </Grid>
  36. <ControlTemplate.Triggers>
  37. <Trigger Property="IsMouseOver" Value="True">
  38. <Setter TargetName="OriginalText" Property="Style" Value="{StaticResource NumberOfPageMouseHoverText}"/>
  39. </Trigger>
  40. </ControlTemplate.Triggers>
  41. </ControlTemplate>
  42. </ResourceDictionary>