CPDFLineStyleUI.xaml 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <UserControl x:Class="Compdfkit_Tools.Common.CPDFLineStyleUI"
  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_Tools.Common"
  7. mc:Ignorable="d"
  8. d:DesignHeight="70" 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. <Grid>
  48. <Grid>
  49. <Grid.ColumnDefinitions>
  50. <ColumnDefinition Width="160"></ColumnDefinition>
  51. <ColumnDefinition></ColumnDefinition>
  52. </Grid.ColumnDefinitions>
  53. <StackPanel Margin="0,12,0,0">
  54. <RadioButton x:Name="SolidRadioButton" Tag="Solid" IsChecked="True" Grid.Row="0" Style="{StaticResource LineRadioButton}" VerticalAlignment="Center" Margin="16,0,0,0" Click="RadioButton_Click">
  55. <Line Name="SolidLineControl" Margin="10,0,0,0" Grid.Column="1" Stroke="#000000" StrokeThickness="1" X1="0" Y1="0" X2="112" Y2="0" VerticalAlignment="Center"></Line>
  56. </RadioButton>
  57. <RadioButton x:Name="DashRadioButton" Tag="Dash" Margin="16,12,0,0" Style="{StaticResource LineRadioButton}" Click="RadioButton_Click">
  58. <Line Name="DashLineControl" Margin="10,0,0,0" Grid.Row="1" Grid.Column="1" Stroke="#000000" StrokeThickness="2" X1="0" Y1="0" X2="112" Y2="0" VerticalAlignment="Center" StrokeDashArray="0,1,1"></Line>
  59. </RadioButton>
  60. </StackPanel>
  61. <local:NumericUpDownControl x:Name="NumericUpDownControl" VerticalAlignment="Bottom" Text="{Binding DashSpacing, Mode=TwoWay}" Grid.Column="1" Width="72" Height="28" Unit="pt" Minimum="1" Maximum="10" IsEnabled="{Binding ElementName=DashRadioButton, Path=IsChecked}"></local:NumericUpDownControl>
  62. </Grid>
  63. </Grid>
  64. </UserControl>