TextAnnotProperty.xaml 5.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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 Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}" Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0">
  33. <Grid>
  34. <TextBlock Name="SampleText" Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Segoe UI" FontSize="18"
  35. Background="{Binding SampleTextBg}"
  36. >
  37. </TextBlock>
  38. <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,60,0,0" Stroke="{Binding SelectColor}" Visibility="{Binding AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotUnderline}">
  39. <Path.Data>
  40. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  41. </Path.Data>
  42. </Path>
  43. <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,50,0,0" Stroke="{Binding SelectColor}" Visibility="{Binding AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotStrikeout}">
  44. <Path.Data>
  45. <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
  46. </Path.Data>
  47. </Path>
  48. <Path Name="SquigglyPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Stroke="{Binding SelectColor}" Visibility="{Binding AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotSquiggly}">
  49. </Path>
  50. <Path Name="StickyPath" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed" Fill="#FF8133"
  51. 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">
  52. </Path>
  53. </Grid>
  54. </Border>
  55. <Grid Margin="0,18,0,0">
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="auto"/>
  58. <RowDefinition/>
  59. </Grid.RowDefinitions>
  60. <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right"
  61. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
  62. <i:Interaction.Triggers>
  63. <i:EventTrigger EventName="SelectedValueChanged">
  64. <i:InvokeCommandAction Command="{Binding SelectedValueChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity,Path=Value}"/>
  65. </i:EventTrigger>
  66. </i:Interaction.Triggers>
  67. </CompositeControl:SlidContent>
  68. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" UIColor="{Binding CurrentColor,Mode=OneWay}" >
  69. <i:Interaction.Triggers>
  70. <i:EventTrigger EventName="SelectedColorInvoke">
  71. <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}"/>
  72. </i:EventTrigger>
  73. </i:Interaction.Triggers>
  74. </CompositeControl:ColorContent>
  75. </Grid>
  76. </StackPanel>
  77. </Grid>
  78. </UserControl>