LinkAnnotProperty.xaml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <UserControl
  2. x:Class="PDF_Master.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_Master.ViewModels.PropertyPanel.AnnotPanel"
  6. xmlns:Convert="clr-namespace:PDF_Master.DataConvert"
  7. xmlns:CustomControl="clr-namespace:PDF_Master.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_Master.Helper"
  11. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  12. xmlns:local="clr-namespace:PDF_Master.Views.BOTA"
  13. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  14. xmlns:prism="http://prismlibrary.com/"
  15. xmlns:property="clr-namespace:PDF_Master.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. Background="{StaticResource color.sys.layout.mg}"
  22. mc:Ignorable="d">
  23. <UserControl.Resources>
  24. <ResourceDictionary>
  25. <ResourceDictionary.MergedDictionaries>
  26. <ResourceDictionary Source="pack://application:,,,/Styles/RadioButtonStyle.xaml" />
  27. </ResourceDictionary.MergedDictionaries>
  28. <Convert:ObjectConvert x:Key="ObjectConvert" />
  29. <Convert:StringToVisibleConvert x:Key="StringToVisibleConvert" />
  30. <Convert:StringToUnVisibleConvert x:Key="StringToUnVisibleConvert" />
  31. <Convert:BoolToVisible x:Key="BoolToVisible" />
  32. <Convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
  33. <Convert:UnVisivleConvert x:Key="UnVisivleConvert" />
  34. </ResourceDictionary>
  35. </UserControl.Resources>
  36. <Grid>
  37. <StackPanel Background="{StaticResource color.sys.layout.mg}" Orientation="Vertical">
  38. <TextBlock
  39. Name="AnnotTypeTitle"
  40. Margin="16,14,0,16"
  41. HorizontalAlignment="Left"
  42. FontFamily="Segoe UI"
  43. FontSize="14"
  44. FontWeight="SemiBold"
  45. LineHeight="24"
  46. Text="{Binding T_Title}" />
  47. <StackPanel
  48. Name="ToggleButtonTab"
  49. Margin="12,0,0,0"
  50. Orientation="Horizontal">
  51. <RadioButton
  52. Name="BtnLinkPage"
  53. Width="75"
  54. Height="28"
  55. VerticalContentAlignment="Center"
  56. Command="{Binding ToggleButtonTabCommand}"
  57. CommandParameter="{Binding ElementName=BtnLinkPage}"
  58. GroupName="LinkTab"
  59. IsChecked="{Binding BtnLinkPageIsChecked}"
  60. Style="{StaticResource PageViewRadioBtn}"
  61. Tag="Page"
  62. Visibility="Collapsed">
  63. <StackPanel>
  64. <Path
  65. Margin="8,8,8,8"
  66. HorizontalAlignment="Center"
  67. Fill="#252629">
  68. <Path.Data>
  69. M12.8335 14.5V5.33432L9.70479 1.5H3.8335V14.5H12.8335ZM3.3335
  70. 0C2.78121 0 2.3335 0.447715 2.3335 1V15C2.3335 15.5523 2.78121 16 3.3335
  71. 16H13.3335C13.8858 16 14.3335 15.5523 14.3335 15V5.15622C14.3335 4.92583
  72. 14.2539 4.70251 14.1083 4.524L10.7169 0.367788C10.527 0.135042 10.2425
  73. 0 9.94214 0H3.3335ZM9.8335 7.25H4.8335V5.75H9.8335V7.25ZM4.8335
  74. 10.25H11.8335V8.75H4.8335V10.25Z
  75. </Path.Data>
  76. </Path>
  77. <TextBlock
  78. x:Name="LinkPageText"
  79. Width="36"
  80. FontFamily="Segoe UI"
  81. FontSize="12"
  82. LineHeight="16"
  83. TextAlignment="Center"
  84. TextWrapping="Wrap" />
  85. </StackPanel>
  86. </RadioButton>
  87. <RadioButton
  88. Name="BtnLinkWeb"
  89. Width="75"
  90. Height="28"
  91. VerticalContentAlignment="Center"
  92. Background="Transparent"
  93. Command="{Binding ToggleButtonTabCommand}"
  94. CommandParameter="{Binding ElementName=BtnLinkWeb}"
  95. GroupName="LinkTab"
  96. IsChecked="{Binding BtnLinkWebIsChecked}"
  97. Style="{StaticResource PageViewRadioBtn}"
  98. Tag="Web"
  99. Visibility="Collapsed">
  100. <StackPanel>
  101. <Path
  102. Margin="8,8,8,8"
  103. HorizontalAlignment="Center"
  104. Fill="#252629">
  105. <Path.Data>
  106. M8.66618 14.4663C8.44716 14.4886 8.22491 14.5 8 14.5C7.85803
  107. 14.5 7.71712 14.4954 7.57741 14.4865C7.10001 13.5646 6.74754
  108. 12.6476 6.49725 11.75H9.73591C9.48745 12.6411 9.13829 13.5512 8.66618
  109. 14.4663ZM10.5459 13.9825C11.6619 13.507 12.6176 12.7283 13.3098
  110. 11.75H11.2887C11.1051 12.4836 10.8609 13.2299 10.5459 13.9825ZM11.5858
  111. 10.25H14.1C14.3587 9.5489 14.5 8.79095 14.5 8C14.5 7.20905 14.3587 6.4511
  112. 14.1 5.75H11.5922C11.7855 7.11458 11.8224 8.63886 11.5858 10.25ZM10.0763
  113. 5.75H6.15683C5.94754 7.09263 5.90154 8.62363 6.16683 10.25H10.0663C10.3316
  114. 8.62363 10.2856 7.09263 10.0763 5.75ZM9.76021 4.25H6.47294C6.78297 3.09108
  115. 7.1942 2.14973 7.56609 1.51425C7.7095 1.5048 7.85419 1.5 8 1.5C8.22937 1.5
  116. 8.45596 1.51188 8.67919 1.53506C9.04787 2.17019 9.45355 3.10366 9.76021
  117. 4.25ZM11.3063 4.25H13.3098C12.6268 3.28462 11.6871 2.5137 10.5902
  118. 2.03658C10.8556 2.67393 11.1063 3.4192 11.3063 4.25ZM4.94441
  119. 11.75C5.13712 12.5199 5.39657 13.3038 5.73452 14.0943C4.49822 13.6345
  120. 3.43967 12.8093 2.69016 11.75H4.94441ZM4.64733 10.25C4.41071 8.63886
  121. 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
  122. 1.89996 10.25H4.64733ZM4.92683 4.25C5.13895 3.36886 5.40812 2.58393 5.69137 1.92192C4.47359 2.38472
  123. 3.43094 3.203 2.69016 4.25H4.92683ZM16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8C0
  124. 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8Z
  125. </Path.Data>
  126. </Path>
  127. </StackPanel>
  128. </RadioButton>
  129. <RadioButton
  130. Name="BtnLinkMail"
  131. Width="75"
  132. Height="28"
  133. VerticalContentAlignment="Center"
  134. Background="Transparent"
  135. Command="{Binding ToggleButtonTabCommand}"
  136. CommandParameter="{Binding ElementName=BtnLinkMail}"
  137. GroupName="LinkTab"
  138. IsChecked="{Binding BtnLinkMailIsChecked}"
  139. Style="{StaticResource PageViewRadioBtn}"
  140. Tag="Mail"
  141. Visibility="Collapsed">
  142. <StackPanel>
  143. <Path
  144. Margin="8,8,8,8"
  145. HorizontalAlignment="Center"
  146. Fill="#252629">
  147. <Path.Data>
  148. M1.5 2.27882V10.5H14.5V2.27882L8.43593 6.6103C8.17516 6.79657
  149. 7.82484 6.79657 7.56407 6.6103L1.5 2.27882ZM13.0097
  150. 1.5H2.99035L8 5.07832L13.0097 1.5ZM0 1C0 0.447715
  151. 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
  152. </Path.Data>
  153. </Path>
  154. </StackPanel>
  155. </RadioButton>
  156. </StackPanel>
  157. <!--<Line
  158. Width="232"
  159. Margin="0,4,0,0"
  160. HorizontalAlignment="Center"
  161. Stroke="#1A000000"
  162. StrokeThickness="1"
  163. X1="0"
  164. X2="232"
  165. Y1="0"
  166. Y2="0" />-->
  167. <StackPanel Orientation="Vertical" Visibility="{Binding IsEmptyPanelVisibility, Converter={StaticResource UnVisivleConvert}}">
  168. <Grid MinWidth="260">
  169. <!--<StackPanel Name="LinkPagePanel" Visibility="{Binding ElementName=BtnLinkPage, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
  170. <StackPanel Name="LinkPagePanel">
  171. <TextBlock
  172. x:Name="TxtPage"
  173. Height="20"
  174. Margin="16,0,0,4"
  175. FontFamily="Segoe UI"
  176. FontSize="12"
  177. FontWeight="Bold"
  178. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  179. LineHeight="20"
  180. Text="{Binding T_Page}" />
  181. <StackPanel Orientation="Horizontal">
  182. <CustomControl:TextBoxWithTip
  183. x:Name="PageNumText"
  184. Width="228"
  185. Margin="16,0"
  186. VerticalContentAlignment="Center"
  187. IsEnabled="{Binding PageNumTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  188. IsError="{Binding ElementName=PageNumText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  189. PlaceHoldText="{Binding PageNumPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  190. ShowTip="{Binding ShowPageNumTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  191. Text="{Binding PageNumTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  192. TipText="{Binding PageNumTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  193. <i:Interaction.Triggers>
  194. <i:EventTrigger EventName="GotFocus">
  195. <i:InvokeCommandAction Command="{Binding PageNumTextGotFocusCommand}" PassEventArgsToCommand="True" />
  196. </i:EventTrigger>
  197. <i:EventTrigger EventName="LostFocus">
  198. <i:InvokeCommandAction Command="{Binding PageNumTextLostFocusCommand}" PassEventArgsToCommand="True" />
  199. </i:EventTrigger>
  200. <i:EventTrigger EventName="KeyDown">
  201. <i:InvokeCommandAction Command="{Binding PageNumTextKeyDownCommand}" PassEventArgsToCommand="True" />
  202. </i:EventTrigger>
  203. </i:Interaction.Triggers>
  204. </CustomControl:TextBoxWithTip>
  205. </StackPanel>
  206. <ToggleButton
  207. Name="BtnLocation"
  208. Width="228"
  209. Height="32"
  210. Margin="16,30,16,0"
  211. Background="Transparent"
  212. BorderBrush="Transparent"
  213. BorderThickness="0"
  214. Command="{Binding LocationCommand}"
  215. IsChecked="{Binding BtnLocationIsChecked}"
  216. IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  217. Style="{StaticResource LinkToolbarTgb}">
  218. <ToggleButton.Content>
  219. <StackPanel Orientation="Horizontal">
  220. <Path
  221. Name="PathLocation"
  222. HorizontalAlignment="Left"
  223. VerticalAlignment="Center"
  224. 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"
  225. Fill=" #616469" />
  226. <TextBlock Margin="10,0" Text="Locate Target Page" />
  227. </StackPanel>
  228. </ToggleButton.Content>
  229. </ToggleButton>
  230. <Image
  231. Name="ImagePreview"
  232. Width="{Binding ImagePreviewWidth}"
  233. Height="{Binding ImagePreviewHeight}"
  234. Margin="32"
  235. Source="{Binding PreviewImage}"
  236. Visibility="{Binding ImagePreviewVisibility}" />
  237. </StackPanel>
  238. <!--<StackPanel Name="LinkWebPanel" Visibility="{Binding ElementName=BtnLinkWeb, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
  239. <StackPanel Name="LinkWebPanel" Visibility="Collapsed">
  240. <TextBlock
  241. Height="20"
  242. Margin="16,12,0,4"
  243. FontFamily="Segoe UI"
  244. FontSize="12"
  245. Foreground="#616469"
  246. LineHeight="20"
  247. Text="URL" />
  248. <StackPanel Orientation="Horizontal">
  249. <CustomControl:TextBoxWithTip
  250. x:Name="PageWebText"
  251. Width="228"
  252. Margin="16,0"
  253. VerticalContentAlignment="Center"
  254. IsEnabled="{Binding PageWebTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  255. IsError="{Binding ElementName=PageWebText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  256. PlaceHoldText="{Binding PageWebPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  257. ShowTip="{Binding ShowPageWebTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  258. Text="{Binding PageWebTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  259. TipText="{Binding PageWebTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  260. <i:Interaction.Triggers>
  261. <i:EventTrigger EventName="LostFocus">
  262. <i:InvokeCommandAction Command="{Binding PageWebTextLostFocusCommand}" PassEventArgsToCommand="True" />
  263. </i:EventTrigger>
  264. <i:EventTrigger EventName="KeyDown">
  265. <i:InvokeCommandAction Command="{Binding PageWebTextKeyDownCommand}" PassEventArgsToCommand="True" />
  266. </i:EventTrigger>
  267. </i:Interaction.Triggers>
  268. </CustomControl:TextBoxWithTip>
  269. </StackPanel>
  270. </StackPanel>
  271. <!--<StackPanel Name="LinkMailPanel" Visibility="{Binding ElementName=BtnLinkMail, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
  272. <StackPanel Name="LinkMailPanel" Visibility="Collapsed">
  273. <TextBlock
  274. Height="20"
  275. Margin="16,12,0,4"
  276. FontFamily="Segoe UI"
  277. FontSize="12"
  278. Foreground="#616469"
  279. LineHeight="20"
  280. Text="Email" />
  281. <StackPanel Orientation="Horizontal">
  282. <CustomControl:TextBoxWithTip
  283. x:Name="PageMailText"
  284. Width="228"
  285. Margin="16,0"
  286. VerticalContentAlignment="Center"
  287. IsEnabled="{Binding PageMailTextIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  288. IsError="{Binding ElementName=PageMailText, Path=ShowTip, Converter={StaticResource VisibleToBoolConvert}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  289. PlaceHoldText="{Binding PageMailPlaceHoldText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  290. ShowTip="{Binding ShowPageMailTip, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  291. Text="{Binding PageMailTextContent, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
  292. TipText="{Binding PageMailTipText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
  293. <i:Interaction.Triggers>
  294. <i:EventTrigger EventName="LostFocus">
  295. <i:InvokeCommandAction Command="{Binding PageMailTextLostFocusCommand}" PassEventArgsToCommand="True" />
  296. </i:EventTrigger>
  297. <i:EventTrigger EventName="KeyDown">
  298. <i:InvokeCommandAction Command="{Binding PageMailTextKeyDownCommand}" PassEventArgsToCommand="True" />
  299. </i:EventTrigger>
  300. </i:Interaction.Triggers>
  301. </CustomControl:TextBoxWithTip>
  302. </StackPanel>
  303. </StackPanel>
  304. </Grid>
  305. <Button
  306. x:Name="BtnGOorBack"
  307. Width="80"
  308. Background="Transparent"
  309. BorderThickness="0"
  310. Command="{Binding BtnGOorBackPageCommand}"
  311. Content="{Binding BtnGOorBackContent}"
  312. FontSize="16"
  313. Style="{StaticResource btn.link}"
  314. Tag="GO"
  315. Visibility="{Binding BtnGOorBackVisibility}">
  316. <Button.CommandParameter>
  317. <MultiBinding Converter="{StaticResource ResourceKey=ObjectConvert}" Mode="TwoWay">
  318. <MultiBinding.Bindings>
  319. <Binding ElementName="BtnGOorBack" />
  320. <Binding ElementName="BtnLinkPage" />
  321. <Binding ElementName="BtnLinkWeb" />
  322. <Binding ElementName="BtnLinkMail" />
  323. </MultiBinding.Bindings>
  324. </MultiBinding>
  325. </Button.CommandParameter>
  326. </Button>
  327. </StackPanel>
  328. <StackPanel
  329. Name="EmptyPanel"
  330. Margin="0,180,0,0"
  331. VerticalAlignment="Center"
  332. Visibility="{Binding IsEmptyPanelVisibility}">
  333. <Image
  334. Width="128"
  335. Height="128"
  336. Source="pack://application:,,,/Resources/PropertyPanel/no link.png" />
  337. <TextBlock
  338. Name="txtEmpty"
  339. Width="168"
  340. Margin="0,12,0,0"
  341. FontFamily="Segoe UI"
  342. FontSize="12"
  343. Foreground="{StaticResource color.sys.text.neutral.lv3}"
  344. Text="{Binding T_EmptyTitle}"
  345. TextAlignment="Center"
  346. TextWrapping="Wrap" />
  347. </StackPanel>
  348. </StackPanel>
  349. </Grid>
  350. <!--<i:Interaction.Triggers>
  351. <i:EventTrigger EventName="Loaded">
  352. <helper:AdvancedInvokeCommandAction
  353. Command="{Binding LoadedCommand}"
  354. CommandParameter="{Binding ElementName=LinkAnnotPropertyContent}"
  355. PassEventArgsToCommand="True" />
  356. </i:EventTrigger>
  357. </i:Interaction.Triggers>-->
  358. </UserControl>