StickyNoteProperty.xaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.StickyNoteProperty"
  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:AnnotPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  8. d:DataContext="{d:DesignInstance Type=AnnotPanel:StickyNotePropertyViewModel}"
  9. xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
  10. xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  11. xmlns:dataConvert="clr-namespace:PDF_Office.DataConvert"
  12. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  13. mc:Ignorable="d"
  14. Loaded="UserControl_Loaded"
  15. Unloaded="UserControl_Unloaded"
  16. d:DesignHeight="450" d:DesignWidth="260" Background="{StaticResource color.sys.layout.mg}">
  17. <UserControl.Resources>
  18. <ResourceDictionary>
  19. <ResourceDictionary.MergedDictionaries>
  20. <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
  21. <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
  22. </ResourceDictionary.MergedDictionaries>
  23. <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter" />
  24. <dataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  25. </ResourceDictionary>
  26. </UserControl.Resources>
  27. <Grid VerticalAlignment="Stretch">
  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. <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
  35. <Path Data="{Binding ExmpleData}" Fill="{Binding SharpColor}" Opacity="{Binding Transpent}" />
  36. </Grid>
  37. </Border>
  38. <Grid Margin="0,18,0,0">
  39. <Grid.RowDefinitions>
  40. <RowDefinition Height="auto" />
  41. <RowDefinition />
  42. </Grid.RowDefinitions>
  43. <TextBlock Text="Color" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" />
  44. <CompositeControl:SlidContent x:Name="SlidOpacity" HorizontalAlignment="Right"
  45. Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
  46. <i:Interaction.Triggers>
  47. <i:EventTrigger EventName="SelectedValueChanged">
  48. <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=SlidOpacity,Path=Value}" />
  49. </i:EventTrigger>
  50. </i:Interaction.Triggers>
  51. </CompositeControl:SlidContent>
  52. <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"
  53. ItemSource="{Binding ColorItems}"
  54. ColorType="Sticky"
  55. UIColor="{Binding SharpCurrentColor,Mode=OneWay}">
  56. <i:Interaction.Triggers>
  57. <i:EventTrigger EventName="SelectedColorInvoke">
  58. <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}" />
  59. </i:EventTrigger>
  60. </i:Interaction.Triggers>
  61. </CompositeControl:ColorContent>
  62. </Grid>
  63. <TextBlock Text="Style" Foreground="{StaticResource color.sys.text.neutral.lv2}" Margin="0,20,0,10" />
  64. <Grid>
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="*" />
  67. <RowDefinition Height="*" />
  68. </Grid.RowDefinitions>
  69. <Grid.ColumnDefinitions>
  70. <ColumnDefinition Width="*" />
  71. <ColumnDefinition Width="*" />
  72. <ColumnDefinition Width="*" />
  73. <ColumnDefinition Width="*" />
  74. </Grid.ColumnDefinitions>
  75. <RadioButton x:Name="BtnComment" Grid.Row="0" Grid.Column="0" Tag="Comment" GroupName="StrickyNote"
  76. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  77. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  78. Style="{StaticResource GreyBgRadioBtnStyle}">
  79. <RadioButton.Content>
  80. <Path Fill="#616469" VerticalAlignment="Center"
  81. Data="M1.54167 2.5C0.96637 2.5 0.5 2.96637 0.5 3.54167V15.2083C0.5 15.7836 0.96637 16.25 1.54167 16.25H3.83344V19.131C3.83344 19.5239 4.25193 19.7753 4.59884 19.5908L10.8802 16.25H19.4583C20.0336 16.25 20.5 15.7836 20.5 15.2083V3.54167C20.5 2.96637 20.0336 2.5 19.4583 2.5H1.54167ZM16.75 8.4375H4.25V6.5625H16.75V8.4375ZM4.25 12.1875H11.75V10.3125H4.25V12.1875Z" />
  82. </RadioButton.Content>
  83. <i:Interaction.Triggers>
  84. <i:EventTrigger EventName="Click">
  85. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnComment,Path=Tag}" />
  86. </i:EventTrigger>
  87. </i:Interaction.Triggers>
  88. </RadioButton>
  89. <RadioButton x:Name="BtnNote" Grid.Row="0" Grid.Column="1" Tag="Note" GroupName="StrickyNote"
  90. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  91. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  92. Style="{StaticResource GreyBgRadioBtnStyle}">
  93. <RadioButton.Content>
  94. <Path Fill="#616469" VerticalAlignment="Center"
  95. Data="M3 1H17V14H12V19H3V1ZM13 19V15H17L13 19ZM15 5V3.5H5V5H15ZM15 8V6.5H5V8H15ZM12 9.5V11H5V9.5H12Z" />
  96. </RadioButton.Content>
  97. <i:Interaction.Triggers>
  98. <i:EventTrigger EventName="Click">
  99. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnNote,Path=Tag}" />
  100. </i:EventTrigger>
  101. </i:Interaction.Triggers>
  102. </RadioButton>
  103. <RadioButton x:Name="BtnKey" Grid.Row="0" Grid.Column="2" Tag="Key" GroupName="StrickyNote"
  104. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  105. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  106. Style="{StaticResource GreyBgRadioBtnStyle}">
  107. <RadioButton.Content>
  108. <Path Fill="#616469" VerticalAlignment="Center"
  109. Data="M14.9552 12.2029C16.009 10.168 15.6751 7.61085 13.9536 5.907C11.8179 3.7932 8.35526 3.7932 6.21956 5.907C4.08386 8.0208 4.08386 11.4479 6.21956 13.5617C7.85915 15.1845 10.2808 15.5615 12.2837 14.6926L17.8206 20.1727H20.6329L20.6329 15.9974L18.1721 15.6495L17.8206 12.518L14.9552 12.2029ZM10.0868 7.64673C10.6692 8.22322 10.6692 9.1579 10.0868 9.73439C9.50432 10.3109 8.55996 10.3109 7.97749 9.73439C7.39503 9.1579 7.39503 8.22322 7.97749 7.64673C8.55996 7.07024 9.50432 7.07024 10.0868 7.64673Z" />
  110. </RadioButton.Content>
  111. <i:Interaction.Triggers>
  112. <i:EventTrigger EventName="Click">
  113. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnKey,Path=Tag}" />
  114. </i:EventTrigger>
  115. </i:Interaction.Triggers>
  116. </RadioButton>
  117. <RadioButton x:Name="BtnHelp" Grid.Row="0" Grid.Column="3" Tag="Help" GroupName="StrickyNote"
  118. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  119. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  120. Style="{StaticResource GreyBgRadioBtnStyle}">
  121. <RadioButton.Content>
  122. <Path Fill="#616469" VerticalAlignment="Center"
  123. Data="M12.5 21C17.4706 21 21.5 16.9706 21.5 12C21.5 7.02944 17.4706 3 12.5 3C7.52944 3 3.5 7.02944 3.5 12C3.5 16.9706 7.52944 21 12.5 21ZM13.0439 13.9512V13.5068C13.0439 12.7891 13.29 12.4062 14.1582 11.8936C15.0332 11.3672 15.5869 10.6084 15.5869 9.54199V9.52832C15.5869 8.12695 14.4111 7.06055 12.6885 7.06055C10.7676 7.06055 9.7832 8.23633 9.70801 9.70605V9.71973L10.8701 9.71289L10.8838 9.70605C10.9521 8.73535 11.6084 8.12695 12.6406 8.12695C13.6592 8.12695 14.3154 8.74902 14.3154 9.58984V9.60352C14.3154 10.3281 14.0078 10.7588 13.2148 11.2441C12.2783 11.8047 11.8408 12.4199 11.8477 13.3223V13.9512H13.0439ZM12.5381 17.123C13.0918 17.123 13.4814 16.7266 13.4814 16.1729C13.4814 15.6123 13.0918 15.2158 12.5381 15.2158C11.9844 15.2158 11.5879 15.6123 11.5879 16.1729C11.5879 16.7266 11.9844 17.123 12.5381 17.123Z" />
  124. </RadioButton.Content>
  125. <i:Interaction.Triggers>
  126. <i:EventTrigger EventName="Click">
  127. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnHelp,Path=Tag}" />
  128. </i:EventTrigger>
  129. </i:Interaction.Triggers>
  130. </RadioButton>
  131. <RadioButton x:Name="BtnInsert" Grid.Row="1" Grid.Column="0" Tag="Insert" GroupName="StrickyNote"
  132. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  133. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  134. Style="{StaticResource GreyBgRadioBtnStyle}">
  135. <RadioButton.Content>
  136. <Path Fill="#616469" VerticalAlignment="Center"
  137. Data="M10.25 13C10.5059 13 10.7565 12.9774 11 12.934V19.5H13V6.5H15V19.5H17V6.5H18.5V4.5H17H15H13H11H10.5V4.50723C10.4173 4.50243 10.3339 4.5 10.25 4.5C7.90279 4.5 6 6.40279 6 8.75C6 11.0972 7.90279 13 10.25 13Z" />
  138. </RadioButton.Content>
  139. <i:Interaction.Triggers>
  140. <i:EventTrigger EventName="Click">
  141. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnInsert,Path=Tag}" />
  142. </i:EventTrigger>
  143. </i:Interaction.Triggers>
  144. </RadioButton>
  145. <RadioButton x:Name="BtnParagraph" Grid.Row="1" Grid.Column="1" Tag="Paragraph" GroupName="StrickyNote"
  146. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  147. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  148. Style="{StaticResource GreyBgRadioBtnStyle}">
  149. <RadioButton.Content>
  150. <Path Fill="#616469" VerticalAlignment="Center"
  151. Data="M12.5 4L19.5 18H5.5L12.5 4Z" />
  152. </RadioButton.Content>
  153. <i:Interaction.Triggers>
  154. <i:EventTrigger EventName="Click">
  155. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnParagraph,Path=Tag}" />
  156. </i:EventTrigger>
  157. </i:Interaction.Triggers>
  158. </RadioButton>
  159. <RadioButton x:Name="BtnNewParagraph" Grid.Row="1" Grid.Column="2" Tag="NewParagraph" GroupName="StrickyNote"
  160. Margin="0,0,8,8" Width="51" Height="32" Foreground="#616469" Background="Transparent"
  161. HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
  162. Style="{StaticResource GreyBgRadioBtnStyle}">
  163. <RadioButton.Content>
  164. <Path Fill="#616469" VerticalAlignment="Center"
  165. Data="M19.5 13L12.5 2L5.5 13H19.5ZM7.46177 17.0425V22H5.90952V14.2495H7.26304L10.8402 19.1855H10.9261V14.2495H12.4784V22H11.1356L7.54771 17.0425H7.46177ZM15.5803 19.5562V22H13.9583V14.2495H17.1541C18.7869 14.2495 19.8772 15.3022 19.8772 16.8975V16.9082C19.8772 18.5034 18.7869 19.5562 17.1541 19.5562H15.5803ZM16.7566 18.2886H15.5803V15.5332H16.7566C17.6858 15.5332 18.2336 16.022 18.2336 16.9028V16.9136C18.2336 17.7944 17.6858 18.2886 16.7566 18.2886Z" />
  166. </RadioButton.Content>
  167. <i:Interaction.Triggers>
  168. <i:EventTrigger EventName="Click">
  169. <i:InvokeCommandAction Command="{Binding StrickyNoteShapeCommand}" CommandParameter="{Binding ElementName=BtnNewParagraph,Path=Tag}" />
  170. </i:EventTrigger>
  171. </i:Interaction.Triggers>
  172. </RadioButton>
  173. </Grid>
  174. </StackPanel>
  175. </Grid>
  176. </UserControl>