StampAnnotProperty.xaml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.StampAnnotProperty"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  5. xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
  9. xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
  10. xmlns:model="clr-namespace:PDF_Office.Model.AnnotPanel"
  11. xmlns:dd="clr-namespace:PDFSettings;assembly=PDFSettings"
  12. xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert"
  13. d:DataContext="{d:DesignInstance Type=annotpanel:StampAnnotPropertyViewModel}"
  14. mc:Ignorable="d"
  15. >
  16. <UserControl.Resources>
  17. <PathGeometry x:Key="Ic_AddButtonPath" Figures="M8.5,2.5 L8.5,7.5 L13.5,7.5 L13.5,8.5 L8.5,8.5 L8.5,13.5 L7.5,13.5 L7.5,8.5 L2.5,8.5 L2.5,7.5 L7.5,7.5 L7.5,2.5 L8.5,2.5 Z"/>
  18. <dataconvert:BoolToVisible x:Key="BoolToVisible"/>
  19. </UserControl.Resources>
  20. <Grid>
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="40"/>
  23. <RowDefinition Height="*"/>
  24. </Grid.RowDefinitions>
  25. <Grid>
  26. <Grid.ColumnDefinitions>
  27. <ColumnDefinition Width="*"/>
  28. <ColumnDefinition Width="auto"/>
  29. </Grid.ColumnDefinitions>
  30. <TextBlock x:Name="AnnoteTypeTitle" Text="Stamp" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0 8 0 0" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18"/>
  31. <customcontrol:PathButton Grid.Column="1"
  32. Visibility="{Binding UnStandard,Converter={StaticResource BoolToVisible}}"
  33. Command="{Binding ShowDialogCommand}"
  34. Height="24" Width="24" IconHeight="20" IconWidth="20"
  35. Icon="{StaticResource Ic_AddButtonPath}" IconFill="Red"
  36. IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
  37. IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" />
  38. </Grid>
  39. <TabControl Grid.Row="1" Name="StampTabControl" SelectedIndex="{Binding TabControlSelectedIndex,Mode=TwoWay}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Style="{StaticResource TabControlWithUnderLineStyle}">
  40. <TabItem x:Name="TabStandard"
  41. Header="Standard"
  42. FontFamily="Segoe UI" Foreground="#FF666666"
  43. HorizontalContentAlignment="Center"
  44. FontSize="16"
  45. Height="40"
  46. Width="88"
  47. IsSelected="True">
  48. <ListBox ItemsSource="{Binding StandardStampList}" SelectionMode="Single" Width="256" Height="auto" VerticalAlignment="Top" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  49. <ListBox.ItemTemplate>
  50. <DataTemplate >
  51. <ListBoxItem >
  52. <ListBoxItem.ContextMenu>
  53. <ContextMenu>
  54. <MenuItem Header="导出图章">
  55. <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click"/>
  56. <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click"/>
  57. </MenuItem>
  58. </ContextMenu>
  59. </ListBoxItem.ContextMenu>
  60. <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="48"/>
  61. </ListBoxItem>
  62. </DataTemplate>
  63. </ListBox.ItemTemplate>
  64. <ListBox.ItemContainerStyle>
  65. <Style TargetType="ListBoxItem">
  66. <Setter Property="Height" Value="64"/>
  67. <Setter Property="Padding" Value="12 8 12 8"/>
  68. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  69. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
  70. </Style>
  71. </ListBox.ItemContainerStyle>
  72. </ListBox>
  73. </TabItem>
  74. <TabItem x:Name="TabDydamic"
  75. Header="Dynamic"
  76. FontFamily="Segoe UI" Foreground="#FF666666"
  77. HorizontalContentAlignment="Center"
  78. FontSize="16"
  79. Width="86">
  80. <ListBox ItemsSource="{Binding DynamicStampList}" Loaded="DydamicListBox_Loaded" SelectionMode="Single" Width="256" Height="auto" VerticalAlignment="Top" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  81. <ListBox.ItemTemplate>
  82. <DataTemplate >
  83. <ListBoxItem>
  84. <Image Source="{Binding ImageSource}" Stretch="Uniform" Height="48"/>
  85. </ListBoxItem>
  86. </DataTemplate>
  87. </ListBox.ItemTemplate>
  88. <ListBox.ItemContainerStyle>
  89. <Style TargetType="ListBoxItem">
  90. <Setter Property="Height" Value="64"/>
  91. <Setter Property="Padding" Value="12 8 12 8"/>
  92. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  93. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
  94. </Style>
  95. </ListBox.ItemContainerStyle>
  96. </ListBox>
  97. </TabItem>
  98. <TabItem x:Name="TabCustom"
  99. Header="Custom"
  100. FontFamily="Segoe UI" Foreground="#FF666666"
  101. FontSize="16"
  102. HorizontalContentAlignment="Center"
  103. Width="76">
  104. <ListBox Name="CusListbox" Margin="0 0 0 56"
  105. VerticalAlignment="Top"
  106. Width="256" Height="auto"
  107. BorderThickness="0"
  108. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  109. ItemsSource="{Binding CustomStampList}"
  110. >
  111. <ListBox.ItemTemplate>
  112. <HierarchicalDataTemplate DataType="{x:Type model:Stamp}" >
  113. <Grid>
  114. <Grid.ContextMenu>
  115. <ContextMenu>
  116. <MenuItem x:Name="Delete" Header="删除图章" Click="Delete_Click"/>
  117. <MenuItem x:Name="DeleteAll" Header="删除全部图章" Click="DeleteAll_Click"/>
  118. <MenuItem Header="导出图章">
  119. <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click"/>
  120. <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click"/>
  121. </MenuItem>
  122. <MenuItem Header="编辑文字图章" Click="Editor_Click"/>
  123. </ContextMenu>
  124. </Grid.ContextMenu>
  125. <Image Source="{Binding SourcePath}"/>
  126. </Grid>
  127. </HierarchicalDataTemplate>
  128. </ListBox.ItemTemplate>
  129. <ListBox.ItemContainerStyle>
  130. <Style TargetType="ListBoxItem">
  131. <Setter Property="Height" Value="64"/>
  132. <Setter Property="Padding" Value="12 8 12 8"/>
  133. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  134. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
  135. </Style>
  136. </ListBox.ItemContainerStyle>
  137. </ListBox>
  138. </TabItem>
  139. </TabControl>
  140. </Grid>
  141. </UserControl>