LinkAnnotProperty.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. <UserControl
  2. x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.LinkAnnotProperty"
  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:Convert="clr-namespace:PDF_Office.DataConvert"
  7. xmlns:CustomControl="clr-namespace:PDF_Office.CustomControl"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:data="clr-namespace:ComPDFKit.PDFDocument;assembly=ComPDFKit.Desk"
  10. xmlns:helper="clr-namespace:PDF_Office.Helper"
  11. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  12. xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
  13. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  14. xmlns:prism="http://prismlibrary.com/"
  15. xmlns:property="clr-namespace:PDF_Office.Properties"
  16. Name="LinkAnnotPropertyContent"
  17. d:DataContext="{d:DesignInstance Type=AnnotPanel:LinkAnnotPropertyViewModel}"
  18. d:DesignHeight="680"
  19. d:DesignWidth="260"
  20. prism:ViewModelLocator.AutoWireViewModel="True"
  21. mc:Ignorable="d">
  22. <UserControl.Resources>
  23. <ResourceDictionary>
  24. <ResourceDictionary.MergedDictionaries>
  25. <ResourceDictionary Source="pack://application:,,,/Styles/RadioButtonStyle.xaml" />
  26. </ResourceDictionary.MergedDictionaries>
  27. <Convert:ObjectConvert x:Key="ObjectConvert" />
  28. <Convert:StringToVisibleConvert x:Key="StringToVisibleConvert" />
  29. <Convert:StringToUnVisibleConvert x:Key="StringToUnVisibleConvert" />
  30. <Convert:BoolToVisible x:Key="BoolToVisible" />
  31. <Convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
  32. </ResourceDictionary>
  33. </UserControl.Resources>
  34. <Grid>
  35. <StackPanel Background="White" Orientation="Vertical">
  36. <TextBlock
  37. Name="AnnotTypeTitle"
  38. Margin="0,12,0,12"
  39. HorizontalAlignment="Left"
  40. FontFamily="Segoe UI"
  41. FontSize="18"
  42. FontWeight="Bold"
  43. LineHeight="24">
  44. Link
  45. </TextBlock>
  46. <StackPanel
  47. Name="ToggleButtonTab"
  48. Margin="12,0,0,0"
  49. Orientation="Horizontal">
  50. <RadioButton
  51. Name="BtnLinkPage"
  52. Width="75"
  53. Height="28"
  54. VerticalContentAlignment="Center"
  55. Command="{Binding ToggleButtonTabCommand}"
  56. CommandParameter="{Binding ElementName=BtnLinkPage}"
  57. GroupName="LinkTab"
  58. IsChecked="{Binding BtnLinkPageIsChecked}"
  59. Style="{StaticResource PageViewRadioBtn}"
  60. Tag="Page">
  61. <StackPanel>
  62. <Path
  63. Margin="8,8,8,8"
  64. HorizontalAlignment="Center"
  65. Fill="#252629">
  66. <Path.Data>
  67. M12.8335 14.5V5.33432L9.70479 1.5H3.8335V14.5H12.8335ZM3.3335
  68. 0C2.78121 0 2.3335 0.447715 2.3335 1V15C2.3335 15.5523 2.78121 16 3.3335
  69. 16H13.3335C13.8858 16 14.3335 15.5523 14.3335 15V5.15622C14.3335 4.92583
  70. 14.2539 4.70251 14.1083 4.524L10.7169 0.367788C10.527 0.135042 10.2425
  71. 0 9.94214 0H3.3335ZM9.8335 7.25H4.8335V5.75H9.8335V7.25ZM4.8335
  72. 10.25H11.8335V8.75H4.8335V10.25Z
  73. </Path.Data>
  74. </Path>
  75. <TextBlock
  76. x:Name="LinkPageText"
  77. Width="36"
  78. FontFamily="Segoe UI"
  79. FontSize="12"
  80. LineHeight="16"
  81. TextAlignment="Center"
  82. TextWrapping="Wrap" />
  83. </StackPanel>
  84. </RadioButton>
  85. <RadioButton
  86. Name="BtnLinkWeb"
  87. Width="75"
  88. Height="28"
  89. VerticalContentAlignment="Center"
  90. Background="Transparent"
  91. Command="{Binding ToggleButtonTabCommand}"
  92. CommandParameter="{Binding ElementName=BtnLinkWeb}"
  93. GroupName="LinkTab"
  94. IsChecked="{Binding BtnLinkWebIsChecked}"
  95. Style="{StaticResource PageViewRadioBtn}"
  96. Tag="Web">
  97. <StackPanel>
  98. <Path
  99. Margin="8,8,8,8"
  100. HorizontalAlignment="Center"
  101. Fill="#252629">
  102. <Path.Data>
  103. M8.66618 14.4663C8.44716 14.4886 8.22491 14.5 8 14.5C7.85803
  104. 14.5 7.71712 14.4954 7.57741 14.4865C7.10001 13.5646 6.74754
  105. 12.6476 6.49725 11.75H9.73591C9.48745 12.6411 9.13829 13.5512 8.66618
  106. 14.4663ZM10.5459 13.9825C11.6619 13.507 12.6176 12.7283 13.3098
  107. 11.75H11.2887C11.1051 12.4836 10.8609 13.2299 10.5459 13.9825ZM11.5858
  108. 10.25H14.1C14.3587 9.5489 14.5 8.79095 14.5 8C14.5 7.20905 14.3587 6.4511
  109. 14.1 5.75H11.5922C11.7855 7.11458 11.8224 8.63886 11.5858 10.25ZM10.0763
  110. 5.75H6.15683C5.94754 7.09263 5.90154 8.62363 6.16683 10.25H10.0663C10.3316
  111. 8.62363 10.2856 7.09263 10.0763 5.75ZM9.76021 4.25H6.47294C6.78297 3.09108
  112. 7.1942 2.14973 7.56609 1.51425C7.7095 1.5048 7.85419 1.5 8 1.5C8.22937 1.5
  113. 8.45596 1.51188 8.67919 1.53506C9.04787 2.17019 9.45355 3.10366 9.76021
  114. 4.25ZM11.3063 4.25H13.3098C12.6268 3.28462 11.6871 2.5137 10.5902
  115. 2.03658C10.8556 2.67393 11.1063 3.4192 11.3063 4.25ZM4.94441
  116. 11.75C5.13712 12.5199 5.39657 13.3038 5.73452 14.0943C4.49822 13.6345
  117. 3.43967 12.8093 2.69016 11.75H4.94441ZM4.64733 10.25C4.41071 8.63886
  118. 4.44762 7.11458 4.64092 5.75H1.89996C1.64127 6.4511 1.5 7.20905 1.5 8C1.5 8.79095 1.64127 9.5489
  119. 1.89996 10.25H4.64733ZM4.92683 4.25C5.13895 3.36886 5.40812 2.58393 5.69137 1.92192C4.47359 2.38472
  120. 3.43094 3.203 2.69016 4.25H4.92683ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0
  121. 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z
  122. </Path.Data>
  123. </Path>
  124. </StackPanel>
  125. </RadioButton>
  126. <RadioButton
  127. Name="BtnLinkMail"
  128. Width="75"
  129. Height="28"
  130. VerticalContentAlignment="Center"
  131. Background="Transparent"
  132. Command="{Binding ToggleButtonTabCommand}"
  133. CommandParameter="{Binding ElementName=BtnLinkMail}"
  134. GroupName="LinkTab"
  135. IsChecked="{Binding BtnLinkMailIsChecked}"
  136. Style="{StaticResource PageViewRadioBtn}"
  137. Tag="Mail">
  138. <StackPanel>
  139. <Path
  140. Margin="8,8,8,8"
  141. HorizontalAlignment="Center"
  142. Fill="#252629">
  143. <Path.Data>
  144. M1.5 2.27882V10.5H14.5V2.27882L8.43593 6.6103C8.17516 6.79657
  145. 7.82484 6.79657 7.56407 6.6103L1.5 2.27882ZM13.0097
  146. 1.5H2.99035L8 5.07832L13.0097 1.5ZM0 1C0 0.447715
  147. 0.447715 0 1 0H15C15.5523 0 16 0.447715 16 1V11C16 11.5523 15.5523 12 15 12H1C0.447715 12 0 11.5523 0 11V1Z
  148. </Path.Data>
  149. </Path>
  150. </StackPanel>
  151. </RadioButton>
  152. </StackPanel>
  153. <!--<Line
  154. Width="232"
  155. Margin="0,4,0,0"
  156. HorizontalAlignment="Center"
  157. Stroke="#1A000000"
  158. StrokeThickness="1"
  159. X1="0"
  160. X2="232"
  161. Y1="0"
  162. Y2="0" />-->
  163. <Grid MinWidth="260">
  164. <StackPanel Name="LinkPagePanel" Visibility="{Binding ElementName=BtnLinkPage, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">
  165. <TextBlock
  166. x:Name="TxtPage"
  167. Height="20"
  168. Margin="16,12,0,4"
  169. FontFamily="Segoe UI"
  170. FontSize="12"
  171. Foreground="#616469"
  172. LineHeight="20"
  173. Text="Page" />
  174. <StackPanel Orientation="Horizontal">
  175. <CustomControl:TextBoxWithTip
  176. x:Name="PageNumText"
  177. Width="228"
  178. Margin="16,0"
  179. VerticalContentAlignment="Center"
  180. IsEnabled="{Binding PageNumTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  181. IsError="{Binding ElementName=PageNumText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  182. PlaceHoldText="{Binding PageNumPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  183. ShowTip="{Binding ShowPageNumTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  184. Text="{Binding PageNumTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  185. TipText="{Binding PageNumTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  186. <i:Interaction.Triggers>
  187. <i:EventTrigger EventName="LostFocus">
  188. <i:InvokeCommandAction Command="{Binding PageNumTextLostFocusCommand}" PassEventArgsToCommand="True" />
  189. </i:EventTrigger>
  190. <i:EventTrigger EventName="KeyDown">
  191. <i:InvokeCommandAction Command="{Binding PageNumTextKeyDownCommand}" PassEventArgsToCommand="True" />
  192. </i:EventTrigger>
  193. </i:Interaction.Triggers>
  194. </CustomControl:TextBoxWithTip>
  195. </StackPanel>
  196. <Button
  197. Name="BtnLocation"
  198. Width="228"
  199. Height="32"
  200. Margin="16,30,16,0"
  201. Command="{Binding LocationCommand}"
  202. IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  203. Style="{StaticResource btn.sec-icon}">
  204. <Button.Content>
  205. <StackPanel Orientation="Horizontal">
  206. <Path
  207. Name="PathLocation"
  208. HorizontalAlignment="Left"
  209. VerticalAlignment="Center"
  210. Data="M15.064 6.88052L13.5661 6.49468L9.57748 11.6857L10.2156 13.8898C10.3593 14.3863 9.74722 14.7479 9.38174 14.3824L6.59721 11.5979L0.0145727 15.9711L4.38786 9.38851L1.60356 6.60421C1.23807 6.23873 1.59967 5.62665 2.09615 5.77038L4.30107 6.40871L9.49166 2.42039L9.10576 0.92227C8.97879 0.42937 9.58359 0.0840825 9.9435 0.443993L15.5423 6.04277C15.9022 6.40268 15.5569 7.00748 15.064 6.88052Z"
  211. Fill=" #616469" />
  212. <TextBlock Margin="10,0" Text="定位目标区域" />
  213. </StackPanel>
  214. </Button.Content>
  215. </Button>
  216. <Image
  217. Name="ImagePreview"
  218. Width="{Binding ImagePreviewWidth}"
  219. Height="{Binding ImagePreviewHeight}"
  220. Margin="32"
  221. Source="{Binding PreviewImage}"
  222. Visibility="{Binding ImagePreviewVisibility}" />
  223. </StackPanel>
  224. <StackPanel Name="LinkWebPanel" Visibility="{Binding ElementName=BtnLinkWeb, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">
  225. <TextBlock
  226. Height="20"
  227. Margin="16,12,0,4"
  228. FontFamily="Segoe UI"
  229. FontSize="12"
  230. Foreground="#616469"
  231. LineHeight="20"
  232. Text="URL" />
  233. <StackPanel Orientation="Horizontal">
  234. <CustomControl:TextBoxWithTip
  235. x:Name="PageWebText"
  236. Width="228"
  237. Margin="16,0"
  238. VerticalContentAlignment="Center"
  239. IsEnabled="{Binding PageWebTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  240. IsError="{Binding ElementName=PageWebText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  241. PlaceHoldText="{Binding PageWebPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  242. ShowTip="{Binding ShowPageWebTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  243. Text="{Binding PageWebTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  244. TipText="{Binding PageWebTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  245. </StackPanel>
  246. </StackPanel>
  247. <StackPanel Name="LinkMailPanel" Visibility="{Binding ElementName=BtnLinkMail, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">
  248. <TextBlock
  249. Height="20"
  250. Margin="16,12,0,4"
  251. FontFamily="Segoe UI"
  252. FontSize="12"
  253. Foreground="#616469"
  254. LineHeight="20"
  255. Text="Email" />
  256. <StackPanel Orientation="Horizontal">
  257. <CustomControl:TextBoxWithTip
  258. x:Name="PageMailText"
  259. Width="228"
  260. Margin="16,0"
  261. VerticalContentAlignment="Center"
  262. IsEnabled="{Binding PageMailTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  263. IsError="{Binding ElementName=PageMailText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  264. PlaceHoldText="{Binding PageMailPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  265. ShowTip="{Binding ShowPageMailTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  266. Text="{Binding PageMailTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  267. TipText="{Binding PageMailTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
  268. </StackPanel>
  269. </StackPanel>
  270. </Grid>
  271. <Button
  272. x:Name="BtnGOorBack"
  273. Background="Transparent"
  274. BorderThickness="0"
  275. Command="{Binding BtnGOorBackPageCommand}"
  276. Content="{Binding BtnGOorBackContent}"
  277. FontSize="16"
  278. Style="{StaticResource btn.link}"
  279. Tag="GO"
  280. Visibility="{Binding BtnGOorBackVisibility}">
  281. <Button.CommandParameter>
  282. <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
  283. <MultiBinding.Bindings>
  284. <Binding ElementName="BtnGOorBack" />
  285. <Binding ElementName="BtnLinkPage" />
  286. <Binding ElementName="BtnLinkWeb" />
  287. <Binding ElementName="BtnLinkMail" />
  288. </MultiBinding.Bindings>
  289. </MultiBinding>
  290. </Button.CommandParameter>
  291. </Button>
  292. </StackPanel>
  293. </Grid>
  294. <!--<i:Interaction.Triggers>
  295. <i:EventTrigger EventName="Loaded">
  296. <helper:AdvancedInvokeCommandAction
  297. Command="{Binding LoadedCommand}"
  298. CommandParameter="{Binding ElementName=LinkAnnotPropertyContent}"
  299. PassEventArgsToCommand="True" />
  300. </i:EventTrigger>
  301. </i:Interaction.Triggers>-->
  302. </UserControl>