12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <UserControl x:Class="Compdfkit_Tools.Common.CPDFLineStyleUI"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:Compdfkit_Tools.Common"
- mc:Ignorable="d"
- d:DesignHeight="70" d:DesignWidth="260">
- <UserControl.Resources>
- <Style x:Key="LineRadioButton" TargetType="{x:Type RadioButton}">
- <Setter Property="HorizontalAlignment" Value="Left"></Setter>
- <Setter Property="VerticalAlignment" Value="Center"></Setter>
- <Setter Property="Height" Value="20"></Setter>
- <Setter Property="Width" Value="200"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RadioButton}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="20"></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <Border x:Name="BackgroundBorder" CornerRadius="20" BorderThickness="2" BorderBrush="#000000" Background="Transparent">
- <Ellipse Name="CheckedEllipse" Height="10" Width="10" Fill="#000000" Visibility="Collapsed"></Ellipse>
- </Border>
- </Grid>
- <ContentPresenter Grid.Column="1"/>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="#477EDE"></Setter>
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="BackgroundBorder" Property="BorderBrush" Value="#477EDE"></Setter>
- <Setter TargetName="BackgroundBorder" Property="Background" Value="#87CEFA"></Setter>
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="CheckedEllipse" Property="Visibility" Value="Visible"></Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <Grid>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="160"></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <StackPanel Margin="0,12,0,0">
- <RadioButton x:Name="SolidRadioButton" Tag="Solid" IsChecked="True" Grid.Row="0" Style="{StaticResource LineRadioButton}" VerticalAlignment="Center" Margin="16,0,0,0" Click="RadioButton_Click">
- <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>
- </RadioButton>
- <RadioButton x:Name="DashRadioButton" Tag="Dash" Margin="16,12,0,0" Style="{StaticResource LineRadioButton}" Click="RadioButton_Click">
- <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>
- </RadioButton>
- </StackPanel>
- <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>
- </Grid>
- </Grid>
- </UserControl>
|