TextAnnotProperty.xaml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <UserControl
  2. x:Class="PDF_Office.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_Office.ViewModels.PropertyPanel.AnnotPanel"
  6. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  7. xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  8. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  9. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  10. xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert"
  11. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  12. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
  13. xmlns:mainpage="clr-namespace:PDF_Office.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="#F3F3F3">
  32. <StackPanel Margin="16,0,16,0">
  33. <TextBlock
  34. Name="AnnotTypeTitle"
  35. Margin="0,16,0,8"
  36. HorizontalAlignment="Left"
  37. FontFamily="Segoe UI"
  38. FontSize="18"
  39. FontWeight="Bold"
  40. LineHeight="24"
  41. Text="{Binding BasicVm.AnnotTypeTitle, Mode=OneWay}" />
  42. <Border
  43. Width="228"
  44. Height="100"
  45. Margin="0,8,0,0"
  46. Background="White"
  47. BorderBrush="#DDDDDD"
  48. BorderThickness="1"
  49. CornerRadius="2"
  50. Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
  51. <Grid>
  52. <Grid.ColumnDefinitions>
  53. <ColumnDefinition Width="*" />
  54. <ColumnDefinition Width="Auto" />
  55. <ColumnDefinition Width="*" />
  56. </Grid.ColumnDefinitions>
  57. <Grid.RowDefinitions>
  58. <RowDefinition Height="*" />
  59. <RowDefinition Height="Auto" />
  60. <RowDefinition Height="*" />
  61. </Grid.RowDefinitions>
  62. <Rectangle
  63. Grid.Row="1"
  64. Grid.Column="1"
  65. HorizontalAlignment="Stretch"
  66. VerticalAlignment="Stretch"
  67. Fill="{Binding BasicVm.FontColor}"
  68. Opacity="{Binding BasicVm.FillOpacity}"
  69. Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotHighlight}" />
  70. <Rectangle
  71. Grid.Row="1"
  72. Grid.Column="1"
  73. Height="2"
  74. HorizontalAlignment="Stretch"
  75. Opacity="{Binding BasicVm.FillOpacity}"
  76. Stroke="{Binding BasicVm.FontColor}"
  77. StrokeThickness="2"
  78. Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotStrikeout}" />
  79. <Rectangle
  80. Grid.Row="1"
  81. Grid.Column="1"
  82. Height="2"
  83. HorizontalAlignment="Stretch"
  84. VerticalAlignment="Bottom"
  85. Opacity="{Binding BasicVm.FillOpacity}"
  86. Stroke="{Binding BasicVm.FontColor}"
  87. StrokeThickness="2"
  88. Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotUnderline}" />
  89. <TextBlock
  90. Name="SampleText"
  91. Grid.Row="1"
  92. Grid.Column="1"
  93. Padding="4,2,4,2"
  94. HorizontalAlignment="Center"
  95. VerticalAlignment="Center"
  96. FontFamily="Segoe UI"
  97. FontSize="18"
  98. FontWeight="Bold"
  99. Text="{x:Static mainpage:MainPage.Sample}" />
  100. </Grid>
  101. </Border>
  102. <Grid Margin="0,18,0,0">
  103. <Grid.RowDefinitions>
  104. <RowDefinition Height="auto" />
  105. <RowDefinition />
  106. </Grid.RowDefinitions>
  107. <CompositeControl:SlidContent
  108. x:Name="SlidOpacity"
  109. Margin="0,0,5,0"
  110. HorizontalAlignment="Right"
  111. InitValue="{Binding BasicVm.FillOpacity, Mode=OneWay}"
  112. Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
  113. <i:Interaction.Triggers>
  114. <i:EventTrigger EventName="SelectedValueChanged">
  115. <i:InvokeCommandAction Command="{Binding SelectedOpacityChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity, Path=Value}" />
  116. </i:EventTrigger>
  117. </i:Interaction.Triggers>
  118. </CompositeControl:SlidContent>
  119. <TextBlock
  120. HorizontalAlignment="Left"
  121. FontFamily="Segoe UI"
  122. FontSize="12"
  123. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  124. Text="Color" />
  125. <CompositeControl:ColorContent
  126. x:Name="cusColor"
  127. Grid.Row="1"
  128. Margin="0,8,0,0"
  129. ColorType="{Binding ColorType}"
  130. ItemSource="{Binding BasicVm.ColorItems}"
  131. UIColor="{Binding BasicVm.CurrentFontColor, Mode=OneWay}">
  132. <i:Interaction.Triggers>
  133. <i:EventTrigger EventName="SelectedColorInvoke">
  134. <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor, Path=SelectedColor}" />
  135. </i:EventTrigger>
  136. </i:Interaction.Triggers>
  137. </CompositeControl:ColorContent>
  138. </Grid>
  139. </StackPanel>
  140. </Grid>
  141. </UserControl>