TextAnnotProperty.xaml 5.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.TextAnnotProperty"
  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:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  8. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:prism="http://prismlibrary.com/"
  11. prism:ViewModelLocator.AutoWireViewModel="True"
  12. xmlns:AnnotPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  13. d:DataContext="{d:DesignInstance Type=AnnotPanel:TextAnnotPropertyViewModel}"
  14. xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  15. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  16. mc:Ignorable="d"
  17. d:DesignHeight="450" d:DesignWidth="800">
  18. <UserControl.Resources>
  19. <ResourceDictionary>
  20. <ResourceDictionary.MergedDictionaries>
  21. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
  22. </ResourceDictionary.MergedDictionaries>
  23. <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter"/>
  24. <convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
  25. </ResourceDictionary>
  26. </UserControl.Resources>
  27. <Grid VerticalAlignment="Stretch" Background="#F3F3F3">
  28. <StackPanel Margin="12 0 12 0">
  29. <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="0,16,0,8"
  30. Text="{Binding AnnotTypeTitle}"
  31. ></TextBlock>
  32. <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
  33. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
  34. >
  35. <Grid>
  36. <TextBlock Name="SampleText" Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Segoe UI" FontSize="18"
  37. Background="{Binding SampleTextBg}"
  38. >
  39. </TextBlock>
  40. <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,60,0,0" Stroke="{Binding SelectColor}" Visibility="{Binding AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotUnderline}">
  41. <Path.Data>
  42. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  43. </Path.Data>
  44. </Path>
  45. <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,50,0,0" Stroke="{Binding SelectColor}" Visibility="{Binding AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotStrikeout}">
  46. <Path.Data>
  47. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  48. </Path.Data>
  49. </Path>
  50. <Path Name="SquigglyPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Stroke="{Binding SelectColor}" Visibility="{Binding AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotSquiggly}">
  51. </Path>
  52. <Path Name="StickyPath" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" Fill="#FF8133"
  53. Data="M28.8,4.8 L28.8,24 L16,24 L8,28.8 L8,24 L3.2,24 L3.2,4.8 L28.8,4.8 Z M24,15.2 L8,15.2 L8,17.6 L24,17.6 L24,15.2 Z M17.6,9.6 L8,9.6 L8,12 L17.6,12 L17.6,9.6 Z">
  54. </Path>
  55. </Grid>
  56. </Border>
  57. <Grid Margin="0,18,0,0">
  58. <Grid.RowDefinitions>
  59. <RowDefinition Height="auto"/>
  60. <RowDefinition/>
  61. </Grid.RowDefinitions>
  62. <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right"
  63. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
  64. <i:Interaction.Triggers>
  65. <i:EventTrigger EventName="SelectedValueChanged">
  66. <i:InvokeCommandAction Command="{Binding SelectedValueChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity,Path=Value}"/>
  67. </i:EventTrigger>
  68. </i:Interaction.Triggers>
  69. </CompositeControl:SlidContent>
  70. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" UIColor="{Binding CurrentColor,Mode=OneWay}" >
  71. <i:Interaction.Triggers>
  72. <i:EventTrigger EventName="SelectedColorInvoke">
  73. <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}"/>
  74. </i:EventTrigger>
  75. </i:Interaction.Triggers>
  76. </CompositeControl:ColorContent>
  77. </Grid>
  78. </StackPanel>
  79. </Grid>
  80. </UserControl>