TextAnnotProperty.xaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <UserControl
  2. x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.TextAnnotProperty"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:AnnotPanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
  6. xmlns:CompositeControl="clr-namespace:PDF_Master.CustomControl.CompositeControl"
  7. xmlns:Convert="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
  8. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  9. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  10. xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert"
  11. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  12. xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel"
  13. xmlns:mainpage="clr-namespace:PDF_Master.Strings.MainPage"
  14. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  15. xmlns:prism="http://prismlibrary.com/"
  16. d:DataContext="{d:DesignInstance Type=AnnotPanel:TextAnnotPropertyViewModel}"
  17. d:DesignHeight="450"
  18. d:DesignWidth="260"
  19. prism:ViewModelLocator.AutoWireViewModel="True"
  20. Background="{StaticResource color.sys.layout.mg}"
  21. mc:Ignorable="d">
  22. <UserControl.Resources>
  23. <ResourceDictionary>
  24. <ResourceDictionary.MergedDictionaries>
  25. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
  26. </ResourceDictionary.MergedDictionaries>
  27. <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter" />
  28. <dataconvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  29. </ResourceDictionary>
  30. </UserControl.Resources>
  31. <Grid VerticalAlignment="Stretch" Background="{StaticResource color.sys.layout.mg}">
  32. <StackPanel Margin="16,0,16,0">
  33. <TextBlock
  34. Name="AnnotTypeTitle"
  35. Margin="0,14"
  36. HorizontalAlignment="Left"
  37. FontFamily="Segoe UI"
  38. FontSize="14"
  39. FontWeight="SemiBold"
  40. LineHeight="24"
  41. Text="{Binding BasicVm.AnnotTypeTitle, Mode=OneWay}" />
  42. <Border
  43. Width="228"
  44. Height="100"
  45. Background="White"
  46. BorderBrush="#DDDDDD"
  47. BorderThickness="1"
  48. CornerRadius="2"
  49. Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
  50. <Grid>
  51. <Grid.ColumnDefinitions>
  52. <ColumnDefinition Width="*" />
  53. <ColumnDefinition Width="Auto" />
  54. <ColumnDefinition Width="*" />
  55. </Grid.ColumnDefinitions>
  56. <Grid.RowDefinitions>
  57. <RowDefinition Height="*" />
  58. <RowDefinition Height="Auto" />
  59. <RowDefinition Height="*" />
  60. </Grid.RowDefinitions>
  61. <Rectangle
  62. Grid.Row="1"
  63. Grid.Column="1"
  64. HorizontalAlignment="Stretch"
  65. VerticalAlignment="Stretch"
  66. Fill="{Binding BasicVm.FontColor}"
  67. Opacity="{Binding BasicVm.FillOpacity}"
  68. Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotHighlight}" />
  69. <Rectangle
  70. Grid.Row="1"
  71. Grid.Column="1"
  72. Height="2"
  73. HorizontalAlignment="Stretch"
  74. Opacity="{Binding BasicVm.FillOpacity}"
  75. Stroke="{Binding BasicVm.FontColor}"
  76. StrokeThickness="2"
  77. Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotStrikeout}" />
  78. <Rectangle
  79. Grid.Row="1"
  80. Grid.Column="1"
  81. Height="2"
  82. HorizontalAlignment="Stretch"
  83. VerticalAlignment="Bottom"
  84. Opacity="{Binding BasicVm.FillOpacity}"
  85. Stroke="{Binding BasicVm.FontColor}"
  86. StrokeThickness="2"
  87. Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotUnderline}" />
  88. <TextBlock
  89. Name="SampleText"
  90. Grid.Row="1"
  91. Grid.Column="1"
  92. Padding="4,2,4,2"
  93. HorizontalAlignment="Center"
  94. VerticalAlignment="Center"
  95. FontFamily="Segoe UI"
  96. FontSize="18"
  97. FontWeight="Bold"
  98. Text="{x:Static mainpage:MainPage.Sample}" />
  99. </Grid>
  100. </Border>
  101. <Grid Margin="0,18,0,0">
  102. <Grid.RowDefinitions>
  103. <RowDefinition Height="auto" />
  104. <RowDefinition />
  105. </Grid.RowDefinitions>
  106. <CompositeControl:SlidContent
  107. x:Name="SlidOpacity"
  108. Margin="0,0,5,0"
  109. HorizontalAlignment="Right"
  110. InitValue="{Binding BasicVm.FillOpacity, Mode=OneWay}"
  111. Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
  112. <i:Interaction.Triggers>
  113. <i:EventTrigger EventName="SelectedValueChanged">
  114. <i:InvokeCommandAction Command="{Binding SelectedOpacityChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity, Path=Value}" />
  115. </i:EventTrigger>
  116. </i:Interaction.Triggers>
  117. </CompositeControl:SlidContent>
  118. <TextBlock
  119. HorizontalAlignment="Left"
  120. FontFamily="Segoe UI"
  121. FontSize="12"
  122. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  123. Text="Color" />
  124. <CompositeControl:ColorContent
  125. x:Name="cusColor"
  126. Grid.Row="1"
  127. Margin="0,8,0,0"
  128. ColorType="{Binding ColorType}"
  129. ItemSource="{Binding BasicVm.ColorItems}"
  130. UIColor="{Binding BasicVm.CurrentFontColor, Mode=TwoWay}" DefaultColor="{Binding TextDefaultColor,Mode=TwoWay}"
  131. DefaultColorVisibility="Visible"
  132. DefaultColorInvoke="cusColor_DefaultColorInvoke">
  133. <i:Interaction.Triggers>
  134. <i:EventTrigger EventName="SelectedColorInvoke">
  135. <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor, Path=SelectedColor}" />
  136. </i:EventTrigger>
  137. </i:Interaction.Triggers>
  138. </CompositeControl:ColorContent>
  139. </Grid>
  140. </StackPanel>
  141. </Grid>
  142. </UserControl>