|
@@ -6,7 +6,10 @@
|
|
|
xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
|
|
|
xmlns:CommonControls="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel.CommonControls"
|
|
|
xmlns:cus="clr-namespace:PDF_Office.CustomControl"
|
|
|
+ xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
+ xmlns:prism="http://prismlibrary.com/"
|
|
|
xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
|
|
|
+ xmlns:EraseThickConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
|
|
|
mc:Ignorable="d"
|
|
|
d:DesignHeight="450" d:DesignWidth="800">
|
|
|
<UserControl.Resources>
|
|
@@ -15,8 +18,12 @@
|
|
|
<ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
|
|
|
<ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
-
|
|
|
+
|
|
|
+ <Convert:BoolToVisible x:Key="BoolToVisible"/>
|
|
|
+ <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
|
|
|
<Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
|
|
|
+ <EraseThickConvert:EraseThicknessConverter x:Key="EraseThicknessConverter"/>
|
|
|
+
|
|
|
<Style x:Key="lineStyle" TargetType="{x:Type Line}">
|
|
|
<Setter Property="Visibility">
|
|
|
<Setter.Value>
|
|
@@ -43,7 +50,7 @@
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
- <ToggleButton Name="PenBtn" IsChecked="True" IsEnabled="True" Tag="PenBtn" Background="Transparent" BorderThickness="0" Click="PenBtn_Click" Command="{Binding PenCommand}" CommandParameter="{Binding ElementName=PenBtn}" >
|
|
|
+ <ToggleButton Name="PenBtn" IsEnabled="True" Tag="PenBtn" Background="Transparent" BorderThickness="0" Click="PenBtn_Click" IsChecked="{Binding IsPen}" Checked="PenBtn_Checked" Command="{Binding PenCommand}" CommandParameter="{Binding ElementName=PenBtn}" >
|
|
|
<Image Width="16" Height="16">
|
|
|
<Image.Source>
|
|
|
<DrawingImage>
|
|
@@ -94,7 +101,7 @@
|
|
|
|
|
|
<Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
|
|
|
<Grid>
|
|
|
- <Path Name="FreehandPath" Fill="{Binding SelectColor}" Stroke="{Binding SelectColor}" StrokeThickness="{Binding ThicknessLine}"
|
|
|
+ <Path Name="FreehandPath" Fill="{Binding SelectColor}" Stroke="{Binding SelectColor}" StrokeThickness="{Binding ThicknessLine}" Visibility="{Binding IsPen,Converter={StaticResource BoolToVisible}}"
|
|
|
Data="M89.6572823,33.0006836 C92.423623,33.0142613 94.9660238,33.2143167 97.6072943,33.6499257 L98.4450428,33.7953737 C99.2868308,33.9487663 100.141867,
|
|
|
34.1261641 101.020317,34.3291126 L101.906948,34.5406353 L102.811448,34.7695353 L103.736075,35.016156 C103.891982,35.0587552 104.048822,35.1021072 104.206642,
|
|
|
35.1462189 L105.165696,35.4200646 L106.150524,35.7124896 L107.163387,36.0238374 L108.206543,36.3544513 L109.833019,36.8872476 L110.961791,37.2675295 L112.128763,
|
|
@@ -117,11 +124,15 @@
|
|
|
36.0041634 C89.916802,36.0024914 89.7799346,36.0013218 89.6425113,36.0006473 C77.496861,35.941034 68.0266419,38.4266795 61.1957691,43.4127083 L60.8119345,
|
|
|
43.6976064 L59,41.3044387 C66.3048995,35.7911443 76.3008484,33.037972 88.9517247,33 L89.6572823,33.0006836 Z" >
|
|
|
</Path>
|
|
|
- <Ellipse Name="ErasePath" Fill="#1A000000" Width="32" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"></Ellipse>
|
|
|
+ <Ellipse Name="ErasePath" Fill="#1A000000"
|
|
|
+ Width="{Binding EraseThicknessLine,Converter={StaticResource EraseThicknessConverter}}"
|
|
|
+ Height="{Binding EraseThicknessLine,Converter={StaticResource EraseThicknessConverter}}"
|
|
|
+ Visibility="{Binding IsPen,Converter={StaticResource InvertBoolToVisibleConvert}}"
|
|
|
+ HorizontalAlignment="Center" VerticalAlignment="Center"></Ellipse>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
|
|
|
- <StackPanel x:Name="PnlPen">
|
|
|
+ <StackPanel x:Name="PnlPen" Visibility="{Binding IsPen,Converter={StaticResource BoolToVisible}}">
|
|
|
<Grid Margin="0,18,0,0">
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="auto"/>
|
|
@@ -148,7 +159,7 @@
|
|
|
|
|
|
<Border Grid.Column="1" BorderBrush="#E2E3E6" Width="80" Height="32" Margin="0,0,12,0" BorderThickness="0">
|
|
|
<Grid>
|
|
|
- <ComboBox Name="BorderDropBox" BorderThickness="1" Padding="10 10 0 0" Background="Transparent" BorderBrush="#FFE2E3E6" >
|
|
|
+ <ComboBox Name="CmbPen" BorderThickness="1" Padding="10 10 0 0" Background="Transparent" BorderBrush="#FFE2E3E6" >
|
|
|
<ComboBox.ItemContainerStyle>
|
|
|
<Style TargetType="{x:Type ComboBoxItem}">
|
|
|
<Setter Property="Padding" Value="10 0 0 0"/>
|
|
@@ -159,6 +170,11 @@
|
|
|
<ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
|
|
|
<ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
|
|
|
<ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="SelectionChanged">
|
|
|
+ <i:InvokeCommandAction Command="{Binding SelectPenThickChangedCommand}" CommandParameter="{Binding ElementName=CmbPen,Path=SelectedItem}"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
</ComboBox>
|
|
|
<TextBox FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Margin="10,0,35,0" IsReadOnly="True"
|
|
|
BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" Text="{Binding ElementName=BorderSlider,Path=Value}">
|
|
@@ -186,7 +202,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
- <StackPanel x:Name="PnlEraser">
|
|
|
+ <StackPanel x:Name="PnlEraser" Visibility="{Binding IsPen,Converter={StaticResource InvertBoolToVisibleConvert}}">
|
|
|
<TextBlock x:Name="eText" LineHeight="20" Margin="12,14,0,0" >Border</TextBlock>
|
|
|
<Grid>
|
|
|
<Grid.ColumnDefinitions>
|
|
@@ -194,6 +210,7 @@
|
|
|
<ColumnDefinition Width="auto"></ColumnDefinition>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<Slider Name="SlEraser" VerticalAlignment="Center" Margin="12,0,4,0" Minimum="1" Maximum="12" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
|
|
|
+ Value="{Binding EraseThicknessLine}"
|
|
|
Style="{StaticResource RoundThumbSlider}" TickFrequency="1" IsSnapToTickEnabled="True" >
|
|
|
<Slider.Resources>
|
|
|
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
|
|
@@ -203,7 +220,7 @@
|
|
|
|
|
|
<Border Grid.Column="1" BorderBrush="#E2E3E6" Width="80" Height="32" Margin="0,0,12,0" BorderThickness="0">
|
|
|
<Grid>
|
|
|
- <ComboBox Name="comBoxEraser" BorderThickness="1" Padding="10 10 0 0" Background="Transparent" BorderBrush="#FFE2E3E6" >
|
|
|
+ <ComboBox Name="CmbEraser" BorderThickness="1" Padding="10 10 0 0" Background="Transparent" BorderBrush="#FFE2E3E6" >
|
|
|
<ComboBox.ItemContainerStyle>
|
|
|
<Style TargetType="{x:Type ComboBoxItem}">
|
|
|
<Setter Property="Padding" Value="10 0 0 0"/>
|
|
@@ -214,9 +231,14 @@
|
|
|
<ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
|
|
|
<ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
|
|
|
<ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
|
|
|
+ <i:Interaction.Triggers>
|
|
|
+ <i:EventTrigger EventName="SelectionChanged">
|
|
|
+ <i:InvokeCommandAction Command="{Binding SetEraserThickCommand}" CommandParameter="{Binding ElementName=CmbEraser,Path=SelectedItem}"/>
|
|
|
+ </i:EventTrigger>
|
|
|
+ </i:Interaction.Triggers>
|
|
|
</ComboBox>
|
|
|
<TextBox FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Margin="10,0,35,0" IsReadOnly="True"
|
|
|
- BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" Text="{Binding ElementName=BorderSlider,Path=Value}">
|
|
|
+ BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" Text="{Binding ElementName=SlEraser,Path=Value}">
|
|
|
</TextBox>
|
|
|
</Grid>
|
|
|
</Border>
|