123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SignatureCreateDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- 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}"
- mc:Ignorable="d" >
- <UserControl.Resources>
- <Style TargetType="{x:Type TabItem}">
- <Setter Property="Width" Value="74.67 " />
- <Setter Property="Height" Value="28" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Template" Value="{DynamicResource Segmented}" />
- </Style>
- <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
- <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
- <dataconvert:IntToColorBrush x:Key="IntToColorBrush"/>
- <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
- <dataconvert:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
- <Style x:Key="TriangleToolTipStyle" TargetType="ToolTip">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <StackPanel>
- <Path HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 6 0 L 0 6 L 12 6 Z" Fill="#E6333333" Margin="0,0,10,0"/>
- <Border CornerRadius="8" Background="#E6333333" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <TextBlock Text="{TemplateBinding ContentControl.Content}" Foreground="White" LineHeight="20" Margin="6"/>
- </Border>
- </StackPanel>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <cus:DialogContent Header="新建签名">
- <cus:DialogContent.Content>
- <TabControl
- Style="{StaticResource FormTabControl }"
- SelectedIndex="{Binding TabItemIndex,Mode=TwoWay}">
- <TabItem Header="Input">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="32"/>
- </Grid.RowDefinitions>
- <cus:TextBoxEx PlaceholderText="Input" Text="{Binding InputText,Mode=TwoWay}" Foreground ="{Binding RadioButtonIndex,Converter={StaticResource IntToColorBrush}}" />
- <ComboBox Grid.Row="1"
- Width="200"
- HorizontalAlignment="Left"
- VerticalContentAlignment="Center"
- ItemsSource="{Binding FontNameList}"
- SelectedIndex="{Binding FontNameIndex,Mode=TwoWay}"/>
- <StackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
- <cus:PathRadioButton Tag="1" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="Black"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="1"/>
- <Binding Path="RadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- <cus:PathRadioButton Tag="2" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="#F66B7C"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="2"/>
- <Binding Path="RadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- <cus:PathRadioButton Tag="3" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="#48DDAD"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="3"/>
- <Binding Path="RadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- <cus:PathRadioButton Tag="4" Checked="TextRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="#458DF6"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="4"/>
- <Binding Path="RadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- </StackPanel>
- </Grid>
- </TabItem>
- <TabItem Header="Drawing">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="32"/>
- </Grid.RowDefinitions>
- <InkCanvas x:Name="inkCanvas" Width="240" Height="240" DefaultDrawingAttributes="{Binding DrawingAttributeObject}" Strokes="{Binding StrokesObject}"/>
- <Grid Opacity="0.7" x:Name="PlanGrid" IsHitTestVisible="False" Background="#F3F3F3" Visibility="{Binding StrokesObject.Count,Converter={StaticResource ListCountToVisible}}">
- <TextBlock Text="此处绘制签名" VerticalAlignment="Center" HorizontalAlignment="Center"/>
- </Grid>
- <Button Style="{StaticResource btn.sec}" Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Clear" Command="{Binding ClearInkCanvasCommnad}" Visibility="{Binding ElementName=PlanGrid,Path=Visibility}"/>
- <ComboBox Grid.Row="1"
- Width="80"
- HorizontalAlignment="Left"
- VerticalContentAlignment="Center"
- ItemsSource="{Binding ThicknessList}"
- SelectedIndex="{Binding ThicknessListIndex,Mode=TwoWay}"/>
- <StackPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" >
- <cus:PathRadioButton Tag="1" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="Black"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="1"/>
- <Binding Path="ImageRadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- <cus:PathRadioButton Tag="2" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="#F66B7C"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="2"/>
- <Binding Path="ImageRadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- <cus:PathRadioButton Tag="3" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="#48DDAD"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="3"/>
- <Binding Path="ImageRadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- <cus:PathRadioButton Tag="4" Checked="ImageRadioButton_Checked" MouseOverBackground="#EDEEF0" MouseDownBackground="#CED0D4" MouseDownBackgroundOpacity="0.6">
- <cus:PathRadioButton.Content>
- <Grid Width="32" Height="32">
- <Ellipse Width="11" Height="11" Fill="#458DF6"/>
- </Grid>
- </cus:PathRadioButton.Content>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding CheckedCommnad}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=RadioButton},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <RadioButton.IsChecked>
- <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
- <Binding Source="4"/>
- <Binding Path="ImageRadioButtonIndex"/>
- </MultiBinding>
- </RadioButton.IsChecked>
- </cus:PathRadioButton>
- </StackPanel>
- </Grid>
- </TabItem>
- <TabItem Header="Picture">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"/>
- <RowDefinition Height="20"/>
- </Grid.RowDefinitions>
- <Button x:Name="BtnAdd" Width="50" Height="50" Content="添加图片" Command="{Binding OpenImageCommnad}" Visibility="{Binding ShowImageButton}"/>
- <Grid Visibility="{Binding ElementName=BtnAdd,Path=Visibility,Converter={StaticResource UnVisivleConvert}}">
- <Grid.RowDefinitions>
- <RowDefinition Height="24"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <Image Grid.RowSpan="2" Width="200" Height="200" Source="{Binding ImagePreviewSource}" />
- <Button Grid.Row="1" Width="50" Height="50" HorizontalAlignment="Left" VerticalAlignment="Bottom" Content="清除" Command="{Binding ClearImageCommnad}"/>
- <Button Grid.Row="1" Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="重新选择" Command="{Binding OpenImageCommnad}"/>
- </Grid>
- <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
- <CheckBox Width="20" Height="20" IsChecked="{Binding IsRemoveBackground}"/>
- <cus:ImageButton Margin="8,0,0,0"
- Height="16" Width="16" IconHeight="16" IconWidth="16"
- Icon="pack://application:,,,/PDF Office;component/Resources/Dialog/help.png"
- IconPress="pack://application:,,,/PDF Office;component/Resources/Dialog/help.png"
- IconMouseOver="pack://application:,,,/PDF Office;component/Resources/Dialog/help.png">
- <cus:ImageButton.ToolTip >
- <ToolTip Style ="{StaticResource TriangleToolTipStyle}" Placement="Bottom" Content="Remove white background from images" >
- <ToolTip.HorizontalOffset>
- <MultiBinding Converter="{StaticResource CenterToolTipConverter}">
- <Binding RelativeSource="{RelativeSource Self}" Path="PlacementTarget.ActualWidth"/>
- <Binding RelativeSource="{RelativeSource Self}" Path="ActualWidth"/>
- </MultiBinding>
- </ToolTip.HorizontalOffset>
- </ToolTip>
- </cus:ImageButton.ToolTip>
- </cus:ImageButton>
- </StackPanel>
- </Grid>
- </TabItem>
- </TabControl>
- </cus:DialogContent.Content>
- <cus:DialogContent.BottmBar>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="50*" />
- <ColumnDefinition Width="50*" />
- </Grid.ColumnDefinitions>
- <Button
- Style="{StaticResource Btn.cta}"
- Grid.Column="0"
- Width="150"
- Height="32"
- Margin="25,0,0,0"
- HorizontalAlignment="Right"
- Command="{Binding CreateCommnad}"
- Content="确定" />
- <Button
- Style="{StaticResource btn.sec}"
- Grid.Column="1"
- Width="150"
- Height="32"
- Margin="0,0,25,0"
- HorizontalAlignment="Right"
- Command="{Binding CancelCommand}"
- Content="取消" />
- </Grid>
- </cus:DialogContent.BottmBar>
- </cus:DialogContent>
- </UserControl>
|