CPDFCloudStyleControl.xaml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <UserControl x:Class="ComPDFKit.Controls.Common.CPDFCloudStyleControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:ComPDFKit.Controls.Common"
  7. mc:Ignorable="d"
  8. d:DesignHeight="80" d:DesignWidth="260">
  9. <UserControl.Resources>
  10. <Style x:Key="LineRadioButton" TargetType="{x:Type RadioButton}">
  11. <Setter Property="HorizontalAlignment" Value="Left"></Setter>
  12. <Setter Property="VerticalAlignment" Value="Center"></Setter>
  13. <Setter Property="Height" Value="20"></Setter>
  14. <Setter Property="Width" Value="200"></Setter>
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="{x:Type RadioButton}">
  18. <Grid>
  19. <Grid.ColumnDefinitions>
  20. <ColumnDefinition Width="20"></ColumnDefinition>
  21. <ColumnDefinition></ColumnDefinition>
  22. </Grid.ColumnDefinitions>
  23. <Grid Grid.Column="0">
  24. <Border x:Name="BackgroundBorder" CornerRadius="20" BorderThickness="2" BorderBrush="#000000" Background="Transparent">
  25. <Ellipse Name="CheckedEllipse" Height="10" Width="10" Fill="#000000" Visibility="Collapsed"></Ellipse>
  26. </Border>
  27. </Grid>
  28. <ContentPresenter Grid.Column="1"/>
  29. </Grid>
  30. <ControlTemplate.Triggers>
  31. <Trigger Property="IsMouseOver" Value="True">
  32. <Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="#477EDE"></Setter>
  33. </Trigger>
  34. <Trigger Property="IsPressed" Value="True">
  35. <Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="#477EDE"></Setter>
  36. <Setter TargetName="BackgroundBorder" Property="Background" Value="#87CEFA"></Setter>
  37. </Trigger>
  38. <Trigger Property="IsChecked" Value="True">
  39. <Setter TargetName="CheckedEllipse" Property="Visibility" Value="Visible"></Setter>
  40. </Trigger>
  41. </ControlTemplate.Triggers>
  42. </ControlTemplate>
  43. </Setter.Value>
  44. </Setter>
  45. </Style>
  46. </UserControl.Resources>
  47. <StackPanel Margin="16,0,0,0" VerticalAlignment="Center">
  48. <RadioButton x:Name="rdoStreat" Tag="Streat" GroupName="Shape" Style="{StaticResource LineRadioButton}" Checked="rdoShape_Checked">
  49. <Rectangle Fill="Black" Height="2" Width="90" HorizontalAlignment="Left" Margin="5,0,0,0"></Rectangle>
  50. </RadioButton>
  51. <RadioButton x:Name="rdoCloud1" GroupName="Shape" IsChecked="True" Style="{StaticResource LineRadioButton}" Tag="Cloud1" Margin="0,6,0,6" Checked="rdoShape_Checked">
  52. <Canvas VerticalAlignment="Center">
  53. <Path Stroke="Black" StrokeThickness="2">
  54. <Path.Data>
  55. <PathGeometry>
  56. <PathFigure StartPoint="20,0">
  57. <ArcSegment Point="6,0" Size="3,3" SweepDirection="Counterclockwise"/>
  58. </PathFigure>
  59. <PathFigure StartPoint="34,0">
  60. <ArcSegment Point="20,0" Size="3,3" SweepDirection="Counterclockwise"/>
  61. </PathFigure>
  62. <PathFigure StartPoint="48,0">
  63. <ArcSegment Point="34,0" Size="3,3" SweepDirection="Counterclockwise"/>
  64. </PathFigure>
  65. <PathFigure StartPoint="62,0">
  66. <ArcSegment Point="48,0" Size="3,3" SweepDirection="Counterclockwise"/>
  67. </PathFigure>
  68. <PathFigure StartPoint="76,0">
  69. <ArcSegment Point="62,0" Size="3,3" SweepDirection="Counterclockwise"/>
  70. </PathFigure>
  71. <PathFigure StartPoint="90,0">
  72. <ArcSegment Point="76,0" Size="3,3" SweepDirection="Counterclockwise"/>
  73. </PathFigure>
  74. </PathGeometry>
  75. </Path.Data>
  76. </Path>
  77. </Canvas>
  78. </RadioButton>
  79. <RadioButton x:Name="rdoCloud2" Tag="Cloud2" GroupName="Shape" Style="{StaticResource LineRadioButton}" Checked="rdoShape_Checked">
  80. <Canvas VerticalAlignment="Center">
  81. <Path Stroke="Black" StrokeThickness="2" Margin="-5,0,0,0">
  82. <Path.Data>
  83. <PathGeometry>
  84. <PathFigure StartPoint="20,0">
  85. <ArcSegment Point="10,0" Size="2,2" SweepDirection="Counterclockwise"/>
  86. </PathFigure>
  87. <PathFigure StartPoint="30,0">
  88. <ArcSegment Point="20,0" Size="2,2" SweepDirection="Counterclockwise"/>
  89. </PathFigure>
  90. <PathFigure StartPoint="40,0">
  91. <ArcSegment Point="30,0" Size="2,2" SweepDirection="Counterclockwise"/>
  92. </PathFigure>
  93. <PathFigure StartPoint="50,0">
  94. <ArcSegment Point="40,0" Size="2,2" SweepDirection="Counterclockwise"/>
  95. </PathFigure>
  96. <PathFigure StartPoint="60,0">
  97. <ArcSegment Point="50,0" Size="2,2" SweepDirection="Counterclockwise"/>
  98. </PathFigure>
  99. <PathFigure StartPoint="70,0">
  100. <ArcSegment Point="60,0" Size="2,2" SweepDirection="Counterclockwise"/>
  101. </PathFigure>
  102. <PathFigure StartPoint="80,0">
  103. <ArcSegment Point="70,0" Size="2,2" SweepDirection="Counterclockwise"/>
  104. </PathFigure>
  105. <PathFigure StartPoint="90,0">
  106. <ArcSegment Point="80,0" Size="2,2" SweepDirection="Counterclockwise"/>
  107. </PathFigure>
  108. </PathGeometry>
  109. </Path.Data>
  110. </Path>
  111. </Canvas>
  112. </RadioButton>
  113. </StackPanel>
  114. </UserControl>