TextFieldProperty.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.TextFieldProperty"
  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:ComPDFKit.Controls.PDFControl" xmlns:cpdfcommon="clr-namespace:ComPDFKit.Controls.Common"
  7. mc:Ignorable="d"
  8. d:DesignHeight="500" d:DesignWidth="300"
  9. Loaded="UserControl_Loaded"
  10. Unloaded="UserControl_Unloaded"
  11. >
  12. <UserControl.Resources>
  13. <ResourceDictionary>
  14. <ResourceDictionary.MergedDictionaries>
  15. <ResourceDictionary Source="../../Asset/Styles/TabControlStyle.xaml"></ResourceDictionary>
  16. <ResourceDictionary Source="../../Asset/Styles/TabItemStyle.xaml"></ResourceDictionary>
  17. <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  18. </ResourceDictionary.MergedDictionaries>
  19. <cpdfcommon:PropertyPanelResourceConverter x:Key="PropertyPanelResourceConverter"></cpdfcommon:PropertyPanelResourceConverter>
  20. </ResourceDictionary>
  21. </UserControl.Resources>
  22. <ScrollViewer VerticalScrollBarVisibility="Auto">
  23. <Grid>
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="40"/>
  26. <RowDefinition Height="*"/>
  27. </Grid.RowDefinitions>
  28. <Border BorderThickness="0" BorderBrush="#1A000000">
  29. <Grid Height="40" Background="White" >
  30. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_TextField}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  31. </Grid>
  32. </Border>
  33. <TabControl Grid.Row="1" Style="{DynamicResource TabControlStyle1}" BorderThickness="0">
  34. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_General}">
  35. <Grid>
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="16"/>
  38. <ColumnDefinition Width="*"/>
  39. <ColumnDefinition Width="16"/>
  40. </Grid.ColumnDefinitions>
  41. <StackPanel Grid.Column="1">
  42. <StackPanel >
  43. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Name}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  44. <TextBox x:Name="FieldNameText" Height="32" Margin="0,8,0,0" TextChanged="FieldNameText_TextChanged"/>
  45. </StackPanel>
  46. <StackPanel >
  47. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Visibility}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  48. <ComboBox x:Name="FormFieldCmb" Height="32" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FormFieldCmb_SelectionChanged">
  49. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Option_Visible}"/>
  50. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Option_Hidden}"/>
  51. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Option_NoPrint}"/>
  52. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Option_Print}"/>
  53. </ComboBox>
  54. </StackPanel>
  55. </StackPanel>
  56. </Grid>
  57. </TabItem>
  58. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_Appearance}">
  59. <Grid>
  60. <Grid.ColumnDefinitions>
  61. <ColumnDefinition Width="16"/>
  62. <ColumnDefinition Width="*"/>
  63. <ColumnDefinition Width="16"/>
  64. </Grid.ColumnDefinitions>
  65. <StackPanel Grid.Column="1">
  66. <StackPanel>
  67. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_StrokeColor}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  68. <cpdfcommon:ColorPickerControl Margin="0,18,0,0" x:Name="BorderColorPickerControl" ColorChanged="BorderColorPickerControl_ColorChanged"/>
  69. </StackPanel>
  70. <StackPanel>
  71. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_BgColor}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  72. <cpdfcommon:ColorPickerControl Margin="0,18,0,0" x:Name="BackgroundColorPickerControl" ColorChanged="BackgroundColorPickerControl_ColorChanged"/>
  73. </StackPanel>
  74. <StackPanel>
  75. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_FontColor}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  76. <cpdfcommon:ColorPickerControl Margin="0,18,0,0" x:Name="TextColorPickerControl" ColorChanged="TextColorPickerControl_ColorChanged"/>
  77. </StackPanel>
  78. <StackPanel>
  79. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Font}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold" />
  80. <ComboBox x:Name="FontCmb" Height="28" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontCmb_SelectionChanged">
  81. </ComboBox>
  82. <StackPanel Orientation="Horizontal" Height="28" Margin="0,8,0,0">
  83. <ComboBox x:Name="FontStyleCmb" Margin="0,0,0,0" Width="148" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontStyleCmb_SelectionChanged">
  84. </ComboBox>
  85. <ComboBox x:Name="FontSizeCmb" Margin="4,0,0,0" Width="72" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="FontSizeCmb_SelectionChanged"/>
  86. </StackPanel>
  87. </StackPanel>
  88. </StackPanel>
  89. </Grid>
  90. </TabItem>
  91. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_Preferences}">
  92. <Grid>
  93. <Grid.ColumnDefinitions>
  94. <ColumnDefinition Width="16"/>
  95. <ColumnDefinition Width="*"/>
  96. <ColumnDefinition Width="16"/>
  97. </Grid.ColumnDefinitions>
  98. <StackPanel Grid.Column="1">
  99. <StackPanel >
  100. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Alignment}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  101. <ComboBox x:Name="TextAlignmentCmb" Height="32" Margin="0,8,0,0" Style="{StaticResource ComboBoxStyle1}" SelectedIndex="0" SelectionChanged="TextAlignmentCmb_SelectionChanged">
  102. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Alignment_Left}"/>
  103. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Alignment_Center}"/>
  104. <ComboBoxItem Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Alignment_Right}"/>
  105. </ComboBox>
  106. </StackPanel>
  107. <StackPanel >
  108. <TextBlock Margin="0,20,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_DefaultValue}" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  109. <TextBox x:Name="DefaultText" Margin="0,8,0,0" Width="224" Height="112" AcceptsReturn="True" TextWrapping="Wrap" TextChanged="DefaultText_TextChanged"/>
  110. <CheckBox x:Name="chkMutiline" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_MultiLine}" FontSize="14" VerticalContentAlignment="Center" Margin="0 14 0 0" Checked="chkMutiline_Checked" Unchecked="chkMutiline_Unchecked"/>
  111. </StackPanel>
  112. </StackPanel>
  113. </Grid>
  114. </TabItem>
  115. </TabControl>
  116. </Grid>
  117. </ScrollViewer>
  118. </UserControl>