123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <UserControl
- x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.SignatureAnnotProperty"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:annotpanel="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
- xmlns:customcontrol="clr-namespace:PDF_Master.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:dataconvert="clr-namespace:PDF_Master.DataConvert"
- xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DataContext="{d:DesignInstance Type=annotpanel:SignatureAnnotPropertyViewModel}"
- Background="{StaticResource color.sys.layout.mg}"
-
- Loaded="UserControl_Loaded"
- mc:Ignorable="d">
- <UserControl.Resources>
- <PathGeometry
- x:Key="Ic_AddButtonPath"
- Figures="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z"
- FillRule="EvenOdd" />
- <dataconvert:ListCountToVisible x:Key="ListCountToVisible" />
- <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
- <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA" />
- <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA" />
- </UserControl.Resources>
- <Grid Background="{StaticResource color.sys.layout.mg}">
- <Grid.RowDefinitions>
- <RowDefinition Height="50" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="16" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="16" />
- </Grid.ColumnDefinitions>
- <Grid x:Name="Header" Grid.Column="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="16" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="16" />
- </Grid.ColumnDefinitions>
- <TextBlock
- x:Name="TxtTitle"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontFamily="Seoge UI"
- FontSize="14"
- FontWeight="SemiBold" />
- <customcontrol:PathButton
- x:Name="BtnAdd"
- Grid.Column="1"
- Width="32"
- Height="32"
- HorizontalAlignment="Right"
- HorizontalContentAlignment="Center"
- BorderThickness="1"
- Command="{Binding ShowDialogCommand}"
- CornerRadius="4"
- Icon="{StaticResource Ic_AddButtonPath}"
- IconFill="#585A63"
- IconHeight="16"
- IconMouseOver="{StaticResource Ic_AddButtonPath}"
- IconMouseOverFill="#585A63"
- IconPress="{StaticResource Ic_AddButtonPath}"
- IconPressFill="#585A63"
- IconWidth="16"
- MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"
- MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}"
- MouseOverBackground="{StaticResource color.item-state.hov.bg}" />
- </Grid>
- <Grid Grid.Row="1" Grid.Column="1">
- <StackPanel
- x:Name="NoSignatureStackPanel"
- VerticalAlignment="Center"
- Visibility="{Binding SignatureList.Count, Converter={StaticResource ListCountToVisible}}">
- <Image
- Width="128"
- Height="128"
- Source="pack://application:,,,/PDF Master;component/Resources/PropertyPanel/nosign.png" />
- <TextBlock
- Height="22"
- HorizontalAlignment="Center"
- FontFamily="Segoe UI"
- FontSize="14"
- Text="No signature created" />
- <TextBlock
- Width="168"
- HorizontalAlignment="Center"
- FontFamily="Segoe UI"
- FontSize="12"
- Foreground="#94989C"
- Text="Click the Add button in the upper right corner to create a new signature."
- TextWrapping="Wrap" />
- </StackPanel>
- <ListBox
- Height="auto"
- VerticalAlignment="Stretch"
- Background="Transparent"
- BorderThickness="0"
- ItemsSource="{Binding SignatureList}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- SelectedIndex="{Binding CurrentListboxIndex, Mode=TwoWay}"
- SelectionMode="Single"
- Visibility="{Binding ElementName=NoSignatureStackPanel, Path=Visibility, Converter={StaticResource UnVisivleConvert}}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ContextMenu>
- <ContextMenu>
- <MenuItem Header="{Binding T_MenuRightMenuSignatureAnnot_Export}">
- <MenuItem
- x:Name="SavePNG"
- Click="Save_Click"
- Header="{Binding T_MenuRightMenuSignatureAnnotExport_PNG}"
- Tag="PNG" />
- <MenuItem
- x:Name="SavePDF"
- Click="Save_Click"
- Header="{Binding T_MenuRightMenuSignatureAnnotExport_PDF}"
- Tag="PDF" />
- </MenuItem>
- <MenuItem
- x:Name="Delete"
- Click="Delete_Click"
- Header="{Binding T_MenuRightMenuSignatureAnnot_Delete}" />
- <MenuItem
- x:Name="DeleteAll"
- Click="DeleteAll_Click"
- Header="{Binding T_MenuRightMenuSignatureAnnot_DeleteAll}" />
- </ContextMenu>
- </Grid.ContextMenu>
- <Image
- Height="48"
- Source="{Binding SourcePath}"
- Stretch="Uniform" />
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Height" Value="65" />
- <Setter Property="Padding" Value="8" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border
- x:Name="Bd"
- Padding="{TemplateBinding Padding}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="8"
- SnapsToDevicePixels="true">
- <ContentPresenter
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
- <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.hov.bg}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="False" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{StaticResource Item.SelectedInactive.Background}" />
- <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource Item.SelectedInactive.Border}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Selector.IsSelectionActive" Value="True" />
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
- </MultiTrigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <EventSetter Event="PreviewMouseDown" Handler="ListBoxItem_PreviewMouseDown" />
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- </Grid>
- </UserControl>
|