SignatureCreateDialog.xaml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SignatureCreateDialog"
  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:PDF_Office.Views.PropertyPanel.AnnotPanel" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel" xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance Type=annotpanel:SignatureCreateDialogViewModel}"
  7. mc:Ignorable="d" >
  8. <UserControl.Resources>
  9. <Style TargetType="{x:Type TabItem}">
  10. <Setter Property="Width" Value="74.67 " />
  11. <Setter Property="Height" Value="28" />
  12. <Setter Property="BorderThickness" Value="0" />
  13. <Setter Property="Template" Value="{DynamicResource Segmented}" />
  14. </Style>
  15. <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
  16. </UserControl.Resources>
  17. <cus:DialogContent Header="新建签名">
  18. <cus:DialogContent.Content>
  19. <TabControl
  20. Style="{StaticResource FormTabControl }"
  21. SelectedIndex="{Binding TabItemIndex,Mode=TwoWay}">
  22. <TabItem Header="Input">
  23. <Grid>
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="*"/>
  26. <RowDefinition Height="32"/>
  27. </Grid.RowDefinitions>
  28. <cus:TextBoxEx PlaceholderText="Input" Text="{Binding InputText,Mode=TwoWay}"/>
  29. <ComboBox Grid.Row="1"
  30. Width="200"
  31. HorizontalAlignment="Left"
  32. VerticalContentAlignment="Center"
  33. ItemsSource="{Binding FontNameList}"
  34. SelectedIndex="{Binding FontNameIndex,Mode=TwoWay}"/>
  35. <StackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
  36. <RadioButton Tag="1">
  37. <i:Interaction.Triggers>
  38. <i:EventTrigger EventName="Checked">
  39. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  40. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  41. PassEventArgsToCommand="True" />
  42. </i:EventTrigger>
  43. </i:Interaction.Triggers>
  44. <RadioButton.IsChecked>
  45. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  46. <Binding Source="1"/>
  47. <Binding Source="RadioButtonIndex"/>
  48. </MultiBinding>
  49. </RadioButton.IsChecked>
  50. </RadioButton>
  51. <RadioButton Tag="2">
  52. <i:Interaction.Triggers>
  53. <i:EventTrigger EventName="Checked">
  54. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  55. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  56. PassEventArgsToCommand="True" />
  57. </i:EventTrigger>
  58. </i:Interaction.Triggers>
  59. <RadioButton.IsChecked>
  60. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  61. <Binding Source="2"/>
  62. <Binding Source="RadioButtonIndex"/>
  63. </MultiBinding>
  64. </RadioButton.IsChecked>
  65. </RadioButton>
  66. <RadioButton Tag="3">
  67. <i:Interaction.Triggers>
  68. <i:EventTrigger EventName="Checked">
  69. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  70. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  71. PassEventArgsToCommand="True" />
  72. </i:EventTrigger>
  73. </i:Interaction.Triggers>
  74. <RadioButton.IsChecked>
  75. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  76. <Binding Source="3"/>
  77. <Binding Source="RadioButtonIndex"/>
  78. </MultiBinding>
  79. </RadioButton.IsChecked>
  80. </RadioButton>
  81. <RadioButton Tag="4">
  82. <i:Interaction.Triggers>
  83. <i:EventTrigger EventName="Checked">
  84. <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
  85. CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
  86. PassEventArgsToCommand="True" />
  87. </i:EventTrigger>
  88. </i:Interaction.Triggers>
  89. <RadioButton.IsChecked>
  90. <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
  91. <Binding Source="4"/>
  92. <Binding Source="RadioButtonIndex"/>
  93. </MultiBinding>
  94. </RadioButton.IsChecked>
  95. </RadioButton>
  96. </StackPanel>
  97. </Grid>
  98. </TabItem>
  99. <TabItem Header="Drawing">
  100. </TabItem>
  101. <TabItem Header="Picture">
  102. <Button Width="50" Height="50" Content="添加图片" Command="{Binding OpenImageCommnad}"/>
  103. </TabItem>
  104. </TabControl>
  105. </cus:DialogContent.Content>
  106. <cus:DialogContent.BottmBar>
  107. <Grid>
  108. <Grid.ColumnDefinitions>
  109. <ColumnDefinition Width="50*" />
  110. <ColumnDefinition Width="50*" />
  111. </Grid.ColumnDefinitions>
  112. <Button
  113. Style="{StaticResource Btn.cta}"
  114. Grid.Column="0"
  115. Width="150"
  116. Height="32"
  117. Margin="25,0,0,0"
  118. HorizontalAlignment="Right"
  119. Command="{Binding CreateCommnad}"
  120. Content="确定" />
  121. <Button
  122. Style="{StaticResource btn.sec}"
  123. Grid.Column="1"
  124. Width="150"
  125. Height="32"
  126. Margin="0,0,25,0"
  127. HorizontalAlignment="Right"
  128. Command="{Binding CancelCommand}"
  129. Content="取消" />
  130. </Grid>
  131. </cus:DialogContent.BottmBar>
  132. </cus:DialogContent>
  133. </UserControl>