SharpsAnnotProperty.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SharpsAnnotProperty"
  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:PDF_Office.Views.PropertyPanel.AnnotPanel"
  7. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  8. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:prism="http://prismlibrary.com/"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
  13. xmlns:DashConvert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  14. mc:Ignorable="d"
  15. d:DesignHeight="450" d:DesignWidth="800">
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
  20. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
  21. </ResourceDictionary.MergedDictionaries>
  22. <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert"></Convert:ColorToBrushConverter>
  23. <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
  24. <DashConvert:DashStyleConverter x:Key="DashStyleConverter"/>
  25. <Style x:Key="line1Style" TargetType="{x:Type Line}">
  26. <Setter Property="Visibility">
  27. <Setter.Value>
  28. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  29. <Binding ElementName="SharpRectBtn" Path="IsChecked"/>
  30. <Binding ElementName="SharpCircleBtn" Path="IsChecked"/>
  31. </MultiBinding>
  32. </Setter.Value>
  33. </Setter>
  34. </Style>
  35. <Style x:Key="line2Style" TargetType="{x:Type Line}">
  36. <Setter Property="Visibility">
  37. <Setter.Value>
  38. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  39. <Binding ElementName="SharpCircleBtn" Path="IsChecked"/>
  40. <Binding ElementName="SharpArrowBtn" Path="IsChecked"/>
  41. </MultiBinding>
  42. </Setter.Value>
  43. </Setter>
  44. </Style>
  45. <Style x:Key="line3Style" TargetType="{x:Type Line}">
  46. <Setter Property="Visibility">
  47. <Setter.Value>
  48. <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
  49. <Binding ElementName="SharpArrowBtn" Path="IsChecked"/>
  50. <Binding ElementName="SharpLineBtn" Path="IsChecked"/>
  51. </MultiBinding>
  52. </Setter.Value>
  53. </Setter>
  54. </Style>
  55. </ResourceDictionary>
  56. </UserControl.Resources>
  57. <Grid Background="#F3F3F3">
  58. <StackPanel>
  59. <TextBlock Name="AnnotTypeTitle" Text="{Binding AnnotTypeTitle}" FontFamily="SegoeUI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0" />
  60. <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
  61. <Grid>
  62. <Path Name="SharpPath" Opacity="{Binding FillOpacity}" StrokeThickness="{Binding LineWidth}" Data="{Binding DataPath}"
  63. Stroke="{Binding SelectColor}"
  64. Fill="{Binding FillColor}" StrokeStartLineCap="Flat"
  65. StrokeDashArray="{Binding Dash,Converter={StaticResource DashStyleConverter}}"
  66. Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center">
  67. <!--,Converter={StaticResource ColorToBrushConvert}-->
  68. </Path>
  69. </Grid>
  70. </Border>
  71. <Border Width="162" Height="32" Margin="0,12,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6">
  72. <Grid Name="ToolGrid">
  73. <Grid.ColumnDefinitions>
  74. <ColumnDefinition Width="40.5"></ColumnDefinition>
  75. <ColumnDefinition Width="40.5"></ColumnDefinition>
  76. <ColumnDefinition Width="40.5"></ColumnDefinition>
  77. <ColumnDefinition Width="40.5"></ColumnDefinition>
  78. </Grid.ColumnDefinitions>
  79. <ToggleButton Name="SharpRectBtn" Tag="Rect" Width="40.5" Background="Transparent" BorderThickness="0" Click="SharpsBtn_Click"
  80. Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpRectBtn,Path=Tag}">
  81. <Rectangle HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" Stroke="#273C62"></Rectangle>
  82. </ToggleButton>
  83. <Line Name="line1" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="1" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000">
  84. </Line>
  85. <ToggleButton Name="SharpCircleBtn" Width="40.5" Tag="Circle" Grid.Column="1" Background="Transparent" BorderThickness="0" Margin="0,0,0,0" Click="SharpsBtn_Click"
  86. Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpCircleBtn,Path=Tag}"
  87. >
  88. <Ellipse Width="16" Height="16" Stroke="#273C62" HorizontalAlignment="Center" VerticalAlignment="Center" ></Ellipse>
  89. </ToggleButton>
  90. <Line Name="line2" HorizontalAlignment="Left" Style="{StaticResource line2Style}" VerticalAlignment="Center" Grid.Column="2" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
  91. <ToggleButton Name="SharpArrowBtn" Width="40.5" Tag="Arrow" Grid.Column="2" Background="Transparent" BorderThickness="0" Click="SharpsBtn_Click"
  92. Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpArrowBtn,Path=Tag}"
  93. >
  94. <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#273C62" Width="16" Height="16">
  95. <Path.Data>
  96. M13.4,2.6 L13.4,8 L12.2,8 L12.1997359,4.648 L2.02426407,14.8242641 L1.17573593,13.9757359 L11.3517359,3.799 L8,3.8 L8,2.6 L13.4,2.6 Z
  97. </Path.Data>
  98. </Path>
  99. </ToggleButton>
  100. <Line x:Name="line3" HorizontalAlignment="Left" Style="{StaticResource line3Style}" VerticalAlignment="Center" Grid.Column="3" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
  101. <ToggleButton Name="SharpLineBtn" Width="40.5" Tag="Line" Grid.Column="3" Background="Transparent" BorderThickness="0" Click="SharpsBtn_Click"
  102. Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpLineBtn,Path=Tag}"
  103. >
  104. <Polygon Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#273C62">
  105. <Polygon.Points>
  106. 13.1757359 1.97573593 14.0242641 2.82426407 2.82426407 14.0242641 1.97573593 13.1757359
  107. </Polygon.Points>
  108. </Polygon>
  109. </ToggleButton>
  110. </Grid>
  111. </Border>
  112. <Grid Margin="0,18,0,0" x:Name="GridFill">
  113. <Grid.RowDefinitions>
  114. <RowDefinition Height="auto"/>
  115. <RowDefinition/>
  116. </Grid.RowDefinitions>
  117. <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right"/>
  118. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusFillColor"/>
  119. </Grid>
  120. <Grid Margin="0,18,0,0">
  121. <Grid.RowDefinitions>
  122. <RowDefinition Height="auto"/>
  123. <RowDefinition/>
  124. </Grid.RowDefinitions>
  125. <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"/>
  126. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
  127. </Grid>
  128. <Grid>
  129. <Grid.ColumnDefinitions>
  130. <ColumnDefinition Width="*"></ColumnDefinition>
  131. <ColumnDefinition Width="auto"></ColumnDefinition>
  132. </Grid.ColumnDefinitions>
  133. <Slider Name="BorderSlider" VerticalAlignment="Center" Value="{Binding LineWidth}" Margin="12,0,4,0" Minimum="1" Maximum="12" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True"
  134. Style="{StaticResource RoundThumbSlider}" TickFrequency="1" IsSnapToTickEnabled="True" >
  135. <Slider.Resources>
  136. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
  137. <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
  138. </Slider.Resources>
  139. </Slider>
  140. <Border Grid.Column="1" BorderBrush="#E2E3E6" Width="80" Height="32" Margin="0,0,12,0" BorderThickness="0">
  141. <Grid>
  142. <ComboBox Name="BorderDropBox" BorderThickness="1" Padding="10 10 0 0" Background="Transparent" BorderBrush="#FFE2E3E6" >
  143. <ComboBox.ItemContainerStyle>
  144. <Style TargetType="{x:Type ComboBoxItem}">
  145. <Setter Property="Padding" Value="10 0 0 0"/>
  146. </Style>
  147. </ComboBox.ItemContainerStyle>
  148. <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
  149. </ComboBoxItem>
  150. <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  151. <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  152. <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  153. <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
  154. <i:Interaction.Triggers>
  155. <i:EventTrigger EventName="SelectionChanged">
  156. <i:InvokeCommandAction Command="{Binding ThicknessChangedCommand}" CommandParameter="{Binding ElementName=BorderDropBox,Path=SelectedItem}"/>
  157. </i:EventTrigger>
  158. </i:Interaction.Triggers>
  159. </ComboBox>
  160. <TextBox FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Margin="10,0,35,0" IsReadOnly="True"
  161. BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" Text="{Binding ElementName=BorderSlider,Path=Value}">
  162. </TextBox>
  163. </Grid>
  164. </Border>
  165. </Grid>
  166. <StackPanel x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
  167. <cus:CustomIconToggleBtn x:Name="BtnSolidLine" Tag="Solid" Width="110" Height="32" Click="BtnLineStyle_Click"
  168. Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnSolidLine,Path=Tag}"
  169. Style="{StaticResource ToggleBtnViewModeStyle}">
  170. <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30">
  171. <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" />
  172. </Border>
  173. </cus:CustomIconToggleBtn>
  174. <cus:CustomIconToggleBtn x:Name="BtnDottedLine" Tag="Dotted" Width="110" Height="32"
  175. Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnDottedLine,Path=Tag}"
  176. Style="{StaticResource ToggleBtnViewModeStyle}" Click="BtnLineStyle_Click">
  177. <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30" >
  178. <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
  179. </Border>
  180. </cus:CustomIconToggleBtn>
  181. </StackPanel>
  182. </StackPanel>
  183. </Grid>
  184. </UserControl>