HeaderFooterCreateContent.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <UserControl x:Class="PDF_Master.Views.EditTools.HeaderFooter.HeaderFooterCreateContent"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. prism:ViewModelLocator.AutoWireViewModel="True"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:cus="clr-namespace:PDF_Master.CustomControl"
  9. xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
  10. xmlns:CompositeControl="clr-namespace:PDF_Master.CustomControl.CompositeControl"
  11. mc:Ignorable="d"
  12. d:DesignHeight="720"
  13. d:DesignWidth="260" >
  14. <UserControl.Resources>
  15. <ResourceDictionary >
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml"></ResourceDictionary>
  18. </ResourceDictionary.MergedDictionaries>
  19. </ResourceDictionary>
  20. </UserControl.Resources>
  21. <Grid>
  22. <Grid.RowDefinitions>
  23. <RowDefinition Height="40"></RowDefinition>
  24. <RowDefinition></RowDefinition>
  25. </Grid.RowDefinitions>
  26. <Grid Grid.Row="0" Visibility="{Binding CreateBaseVisible, Mode=TwoWay}">
  27. <Button Height="24" Width="124" HorizontalAlignment="Left" Margin="16,0,0,0" Command="{Binding EnterTemplateListCommand}">
  28. <StackPanel Orientation="Horizontal">
  29. <TextBlock Text="&lt;" Margin="0,0,9,0" FontSize="16"></TextBlock>
  30. <TextBlock Text="创建页眉页脚" FontSize="16"></TextBlock>
  31. </StackPanel>
  32. </Button>
  33. <Button Height="20" Width="64" Margin="0,0,16,0" HorizontalAlignment="Right" Command="{Binding SaveToTemplateListCommand}">
  34. <StackPanel>
  35. <TextBlock Text="保存至模板" Foreground="#18A0FB"></TextBlock>
  36. <Rectangle Height="1" Fill="#18A0FB"></Rectangle>
  37. </StackPanel>
  38. </Button>
  39. </Grid>
  40. <Grid Grid.Row="0" Visibility="{Binding EditBaseVisible, Mode=TwoWay}">
  41. <Button Height="24" Width="90" HorizontalAlignment="Left" Margin="16,0,0,0" Command="{Binding EnterTemplateListCommand}">
  42. <StackPanel Orientation="Horizontal">
  43. <TextBlock Text="&lt;" Margin="0,0,9,0" FontSize="16"></TextBlock>
  44. <TextBlock Text="编辑模板" FontSize="16"></TextBlock>
  45. </StackPanel>
  46. </Button>
  47. <Button Height="20" Width="64" Margin="0,0,16,0" HorizontalAlignment="Right" Command="{Binding SaveToCurrentTemplateListCommand}">
  48. <StackPanel>
  49. <TextBlock Text="保存" Foreground="#18A0FB"></TextBlock>
  50. <Rectangle Height="1" Fill="#18A0FB"></Rectangle>
  51. </StackPanel>
  52. </Button>
  53. </Grid>
  54. <Grid Grid.Row="1">
  55. <Grid.RowDefinitions>
  56. <RowDefinition Height="116"></RowDefinition>
  57. <RowDefinition Height="116"></RowDefinition>
  58. <RowDefinition Height="128"></RowDefinition>
  59. <RowDefinition Height="172"></RowDefinition>
  60. <RowDefinition></RowDefinition>
  61. </Grid.RowDefinitions>
  62. <Grid Grid.Row="0" Margin="0,16,0,0" Width="228">
  63. <StackPanel>
  64. <TextBlock Text="外观" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
  65. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  66. <ComboBox Width="154" Height="32" ItemsSource="{Binding FontNameList}" SelectedIndex="{Binding FontNameSelectedIndex}"></ComboBox>
  67. <ComboBox Width="66" Height="32" Margin="8,0,0,0" ItemsSource="{Binding FontSizeList}" SelectedIndex="{Binding FontSizeSelectedIndex}"></ComboBox>
  68. </StackPanel>
  69. <CompositeControl:ColorContent x:Name="cusColor" Height="32" Width="66" Margin="0,8,0,0" HorizontalAlignment="Left">
  70. </CompositeControl:ColorContent>
  71. </StackPanel>
  72. </Grid>
  73. <Grid Grid.Row="1" Margin="0,16,0,0" Width="228">
  74. <StackPanel>
  75. <TextBlock Text="页边距" FontSize="12" Foreground="#666666" Height="20" Width="36" HorizontalAlignment="Left"></TextBlock>
  76. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  77. <StackPanel Orientation="Vertical" Margin="0,0,0,0">
  78. <StackPanel Orientation="Horizontal">
  79. <TextBlock Text="上" Width="14" Height="20" VerticalAlignment="Center"/>
  80. <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0" Text="{Binding MarginTopValue,Mode=TwoWay}"></cus:NumericUpDown>
  81. </StackPanel>
  82. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  83. <TextBlock Text="左" Width="14" Height="20" VerticalAlignment="Center"/>
  84. <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0" Text="{Binding MarginLeftValue,Mode=TwoWay}"></cus:NumericUpDown>
  85. </StackPanel>
  86. </StackPanel>
  87. <StackPanel Orientation="Vertical" Margin="51,0,0,0">
  88. <StackPanel Orientation="Horizontal">
  89. <TextBlock Text="下" Width="14" Height="20" VerticalAlignment="Center"/>
  90. <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0" Text="{Binding MarginDownValue,Mode=TwoWay}"></cus:NumericUpDown>
  91. </StackPanel>
  92. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  93. <TextBlock Text="右" Width="14" Height="20" VerticalAlignment="Center"/>
  94. <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0" Text="{Binding MarginRightValue,Mode=TwoWay}"></cus:NumericUpDown>
  95. </StackPanel>
  96. </StackPanel>
  97. </StackPanel>
  98. </StackPanel>
  99. </Grid>
  100. <Grid Grid.Row="2" Margin="0,16,0,0" Width="228">
  101. <StackPanel>
  102. <StackPanel>
  103. <TextBlock Text="日期" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
  104. <ComboBox Height="32" ItemsSource="{Binding DateTimeFormatList}" SelectedIndex="{Binding DateTimeFormatIndex}"></ComboBox>
  105. </StackPanel>
  106. <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
  107. <StackPanel>
  108. <TextBlock Text="页面" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
  109. <ComboBox Height="32" Width="110" ItemsSource="{Binding PageNumberFormatList}" SelectedIndex="{Binding PageNumberFormatIndex}"></ComboBox>
  110. </StackPanel>
  111. <StackPanel Margin="8,0,0,0">
  112. <TextBlock Text="起始页" FontSize="12" Foreground="#666666" Height="20" Width="36" HorizontalAlignment="Left"></TextBlock>
  113. <ComboBox Height="32" Width="110" ItemsSource="{Binding StarPagetNumberList}" SelectedIndex="{Binding StarPagetNumberIndex}"></ComboBox>
  114. </StackPanel>
  115. </StackPanel>
  116. </StackPanel>
  117. </Grid>
  118. <Grid Grid.Row="3" Margin="0,16,0,0" Width="228">
  119. <StackPanel>
  120. <StackPanel Orientation="Horizontal">
  121. <TextBlock Text="布局&amp;内容" FontSize="12" Foreground="#666666" Height="20" Width="60"></TextBlock>
  122. <Button Width="22" Height="22" Margin="146,0,0,0" Click="Button_Click">
  123. <TextBlock Text="+" FontSize="19" HorizontalAlignment="Center" VerticalAlignment="Center" Block.TextAlignment="Center" ></TextBlock>
  124. <Button.ContextMenu>
  125. <ContextMenu Name="contextMenu">
  126. <MenuItem Name="ADDPages" Header="插入页码" Click="ADDPages_Click" >
  127. </MenuItem>
  128. <MenuItem Name="ADDDate" Header="插入日期" Click="ADDDate_Click">
  129. </MenuItem>
  130. </ContextMenu>
  131. </Button.ContextMenu>
  132. </Button>
  133. </StackPanel>
  134. <Grid Width="228" Height="46" Margin="0,6,0,0">
  135. <Grid.ColumnDefinitions>
  136. <ColumnDefinition Width="76"></ColumnDefinition>
  137. <ColumnDefinition Width="76"></ColumnDefinition>
  138. <ColumnDefinition Width="76"></ColumnDefinition>
  139. </Grid.ColumnDefinitions>
  140. <Grid.RowDefinitions>
  141. <RowDefinition Height="23"></RowDefinition>
  142. <RowDefinition Height="23"></RowDefinition>
  143. </Grid.RowDefinitions>
  144. <RadioButton Grid.Column="0" Grid.Row="0" Tag="0" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsChecked="True"></RadioButton>
  145. <RadioButton Grid.Column="1" Grid.Row="0" Tag="1" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
  146. <RadioButton Grid.Column="2" Grid.Row="0" Tag="2" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
  147. <RadioButton Grid.Column="0" Grid.Row="1" Tag="3" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"></RadioButton>
  148. <RadioButton Grid.Column="1" Grid.Row="1" Tag="4" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
  149. <RadioButton Grid.Column="2" Grid.Row="1" Tag="5" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"></RadioButton>
  150. </Grid>
  151. <TextBox Name="TextValueTextBox" Height="72" Margin="0,8,0,0" Text="{Binding TextValue}" Foreground="{Binding SolidColorBrush}" FontSize="14" AcceptsReturn="True">
  152. <i:Interaction.Triggers>
  153. <i:EventTrigger EventName="TextChanged">
  154. <i:InvokeCommandAction Command="{Binding TextValueChangedCommand}" CommandParameter="{Binding ElementName=TextValueTextBox}" />
  155. </i:EventTrigger>
  156. </i:Interaction.Triggers>
  157. </TextBox>
  158. </StackPanel>
  159. </Grid>
  160. <Grid Grid.Row="4" Margin="0,16,0,0" Width="228">
  161. <StackPanel>
  162. <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
  163. <cus:WritableComboBox Height="32" Margin="0,8,0,0" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" ></cus:WritableComboBox>
  164. </StackPanel>
  165. </Grid>
  166. </Grid>
  167. </Grid>
  168. </UserControl>