PathRadioButtonDictionary.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:customControl="clr-namespace:PDF_Master.CustomControl">
  5. <Style TargetType="{x:Type customControl:PathRadioButton}">
  6. <Setter Property="IconOpacity" Value="1" />
  7. <Setter Property="IconMouseOverOpacity" Value="1" />
  8. <Setter Property="IconPressOpacity" Value="1" />
  9. <Setter Property="IconCheckedOpacity" Value="1" />
  10. <Setter Property="Background" Value="Transparent" />
  11. <Setter Property="Template">
  12. <Setter.Value>
  13. <ControlTemplate TargetType="{x:Type customControl:PathRadioButton}">
  14. <Border
  15. Background="{TemplateBinding Background}"
  16. BorderBrush="{TemplateBinding BorderBrush}"
  17. BorderThickness="{TemplateBinding BorderThickness}">
  18. <Grid x:Name="grid" Background="{TemplateBinding Background}">
  19. <Border
  20. x:Name="PART_Border"
  21. Background="{TemplateBinding Background}"
  22. BorderBrush="{TemplateBinding BorderBrush}"
  23. BorderThickness="{TemplateBinding BorderThickness}"
  24. CornerRadius="{TemplateBinding CornerRadius}" />
  25. <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
  26. <StackPanel
  27. Margin="{TemplateBinding Padding}"
  28. HorizontalAlignment="Center"
  29. VerticalAlignment="Center"
  30. Orientation="{TemplateBinding IconContentOrientation}">
  31. <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
  32. <Path
  33. x:Name="PART_Icon"
  34. Width="{TemplateBinding IconWidth}"
  35. Height="{TemplateBinding IconHeight}"
  36. Data="{TemplateBinding Icon}"
  37. Fill="{TemplateBinding IconFill}"
  38. Opacity="{TemplateBinding IconOpacity}" />
  39. <Path
  40. x:Name="PART_MouseOverIcon"
  41. Width="{TemplateBinding IconWidth}"
  42. Height="{TemplateBinding IconHeight}"
  43. Data="{TemplateBinding IconMouseOver}"
  44. Fill="{TemplateBinding IconMouseOverFill}"
  45. Opacity="{TemplateBinding IconMouseOverOpacity}"
  46. Visibility="Collapsed" />
  47. <Path
  48. x:Name="PART_PressIcon"
  49. Width="{TemplateBinding IconWidth}"
  50. Height="{TemplateBinding IconHeight}"
  51. Data="{TemplateBinding IconPress}"
  52. Fill="{TemplateBinding IconPressFill}"
  53. Opacity="{TemplateBinding IconPressOpacity}"
  54. Visibility="Collapsed" />
  55. <Path
  56. x:Name="PART_CheckedIcon"
  57. Width="{TemplateBinding IconWidth}"
  58. Height="{TemplateBinding IconHeight}"
  59. Data="{TemplateBinding IconChecked}"
  60. Fill="{TemplateBinding IconCheckedFill}"
  61. Opacity="{TemplateBinding IconCheckedOpacity}"
  62. Visibility="Collapsed" />
  63. </Grid>
  64. <TextBlock
  65. x:Name="PART_Content"
  66. Margin="{TemplateBinding IconContentMargin}"
  67. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  68. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  69. Foreground="{TemplateBinding Foreground}"
  70. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  71. Text="{TemplateBinding Content}"
  72. TextTrimming="CharacterEllipsis" />
  73. </StackPanel>
  74. <ContentPresenter
  75. Margin="{TemplateBinding Padding}"
  76. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  77. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  78. Focusable="False"
  79. RecognizesAccessKey="True"
  80. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  81. </Grid>
  82. </Grid>
  83. </Border>
  84. <ControlTemplate.Triggers>
  85. <Trigger Property="IsMouseOver" Value="True">
  86. <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  87. <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  88. <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseOverBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  89. <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  90. <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
  91. <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
  92. <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
  93. <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
  94. </Trigger>
  95. <Trigger Property="IsPressed" Value="True">
  96. <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  97. <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  98. <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseDownBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  99. <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  100. <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
  101. <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
  102. <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
  103. <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
  104. </Trigger>
  105. <Trigger Property="IsEnabled" Value="False">
  106. <Setter Property="Opacity" Value="0.5" />
  107. </Trigger>
  108. <Trigger Property="IsChecked" Value="True">
  109. <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  110. <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  111. <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseDownBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  112. <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
  113. <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
  114. <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
  115. <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
  116. <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Visible" />
  117. </Trigger>
  118. <Trigger SourceName="PART_Content" Property="Text" Value="">
  119. <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
  120. </Trigger>
  121. <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
  122. <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
  123. </Trigger>
  124. </ControlTemplate.Triggers>
  125. </ControlTemplate>
  126. </Setter.Value>
  127. </Setter>
  128. </Style>
  129. </ResourceDictionary>