|
@@ -1,53 +1,68 @@
|
|
-<UserControl x:Class="PDF_Master.Views.Dialog.ToolsDialogs.SaftyDialogs.CheckPasswordDialog"
|
|
|
|
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
- xmlns:prism="http://prismlibrary.com/" xmlns:cus="clr-namespace:PDF_Master.CustomControl"
|
|
|
|
- prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
|
|
|
|
- xmlns:help="clr-namespace:PDF_Master.Helper" xmlns:saftydialogs="clr-namespace:PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
- prism:ViewModelLocator.AutoWireViewModel="True">
|
|
|
|
|
|
+<UserControl
|
|
|
|
+ x:Class="PDF_Master.Views.Dialog.ToolsDialogs.SaftyDialogs.CheckPasswordDialog"
|
|
|
|
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
+ xmlns:cus="clr-namespace:PDF_Master.CustomControl"
|
|
|
|
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
+ xmlns:help="clr-namespace:PDF_Master.Helper"
|
|
|
|
+ xmlns:prism="http://prismlibrary.com/"
|
|
|
|
+ xmlns:saftydialogs="clr-namespace:PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs"
|
|
|
|
+ prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
|
|
|
|
+ prism:ViewModelLocator.AutoWireViewModel="True">
|
|
<UserControl.Resources>
|
|
<UserControl.Resources>
|
|
- <Style TargetType="PasswordBox" x:Key="CheckPasswordBoxStyle">
|
|
|
|
- <Setter Property="Height" Value="32"/>
|
|
|
|
- <Setter Property="FontSize" Value="14"/>
|
|
|
|
|
|
+ <Style x:Key="CheckPasswordBoxStyle" TargetType="PasswordBox">
|
|
|
|
+ <Setter Property="Height" Value="32" />
|
|
|
|
+ <Setter Property="FontSize" Value="14" />
|
|
<Setter Property="Template">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="PasswordBox">
|
|
<ControlTemplate TargetType="PasswordBox">
|
|
- <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
- BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
- Background="{TemplateBinding Background}"
|
|
|
|
- SnapsToDevicePixels="True"
|
|
|
|
- CornerRadius="5">
|
|
|
|
|
|
+ <Border
|
|
|
|
+ x:Name="border"
|
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
|
+ BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
|
+ BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
|
+ CornerRadius="5"
|
|
|
|
+ SnapsToDevicePixels="True">
|
|
<Grid>
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
- <ColumnDefinition></ColumnDefinition>
|
|
|
|
- <ColumnDefinition Width="24"></ColumnDefinition>
|
|
|
|
|
|
+ <ColumnDefinition />
|
|
|
|
+ <ColumnDefinition Width="24" />
|
|
</Grid.ColumnDefinitions>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid Grid.Column="0" Margin="8,0,0,0">
|
|
<Grid Grid.Column="0" Margin="8,0,0,0">
|
|
- <TextBlock Text="{TemplateBinding help:PasswordBoxHelper.DisplayText}" Grid.Column="1" VerticalAlignment="Center" Foreground="#BBB"
|
|
|
|
- Name="markText" Visibility="Collapsed" FontSize="12" />
|
|
|
|
- <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
|
|
|
|
- HorizontalScrollBarVisibility="Hidden"
|
|
|
|
- VerticalScrollBarVisibility="Hidden"
|
|
|
|
- VerticalAlignment="Center" MinHeight="20"/>
|
|
|
|
|
|
+ <TextBlock
|
|
|
|
+ Name="markText"
|
|
|
|
+ Grid.Column="1"
|
|
|
|
+ VerticalAlignment="Center"
|
|
|
|
+ FontSize="12"
|
|
|
|
+ Foreground="#BBB"
|
|
|
|
+ Text="{TemplateBinding help:PasswordBoxHelper.DisplayText}"
|
|
|
|
+ Visibility="Collapsed" />
|
|
|
|
+ <ScrollViewer
|
|
|
|
+ x:Name="PART_ContentHost"
|
|
|
|
+ MinHeight="20"
|
|
|
|
+ VerticalAlignment="Center"
|
|
|
|
+ Focusable="false"
|
|
|
|
+ HorizontalScrollBarVisibility="Hidden"
|
|
|
|
+ VerticalScrollBarVisibility="Hidden" />
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
- <Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
|
|
|
|
|
+ <Setter TargetName="border" Property="Opacity" Value="0.56" />
|
|
</Trigger>
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
<Trigger Property="IsMouseOver" Value="true">
|
|
- <Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
|
|
|
|
|
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF7EB4EA" />
|
|
</Trigger>
|
|
</Trigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true">
|
|
<Trigger Property="IsKeyboardFocused" Value="true">
|
|
- <Setter Property="BorderBrush" TargetName="border" Value="#1770F4"/>
|
|
|
|
|
|
+ <Setter TargetName="border" Property="BorderBrush" Value="#1770F4" />
|
|
</Trigger>
|
|
</Trigger>
|
|
- <DataTrigger Binding="{Binding Path = Password}" Value="">
|
|
|
|
- <Setter Property="Visibility" TargetName="markText" Value="Visible"/>
|
|
|
|
|
|
+ <DataTrigger Binding="{Binding Path=Password}" Value="">
|
|
|
|
+ <Setter TargetName="markText" Property="Visibility" Value="Visible" />
|
|
</DataTrigger>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding Path=IsRightValue}" Value="false">
|
|
<DataTrigger Binding="{Binding Path=IsRightValue}" Value="false">
|
|
- <Setter Property="BorderBrush" TargetName="border" Value="#F3465B"/>
|
|
|
|
|
|
+ <Setter TargetName="border" Property="BorderBrush" Value="#F3465B" />
|
|
</DataTrigger>
|
|
</DataTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</ControlTemplate>
|
|
@@ -55,18 +70,18 @@
|
|
</Setter>
|
|
</Setter>
|
|
</Style>
|
|
</Style>
|
|
|
|
|
|
- <Style TargetType="Button" x:Key="DeletePasswordButtonStyle">
|
|
|
|
- <Setter Property="Height" Value="14"></Setter>
|
|
|
|
- <Setter Property="Width" Value="14"></Setter>
|
|
|
|
- <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
|
|
|
|
- <Setter Property="VerticalContentAlignment" Value="Center"></Setter>
|
|
|
|
|
|
+ <Style x:Key="DeletePasswordButtonStyle" TargetType="Button">
|
|
|
|
+ <Setter Property="Height" Value="14" />
|
|
|
|
+ <Setter Property="Width" Value="14" />
|
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="Template">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ButtonBase}">
|
|
<ControlTemplate TargetType="{x:Type ButtonBase}">
|
|
<Grid>
|
|
<Grid>
|
|
<Viewbox Stretch="Uniform">
|
|
<Viewbox Stretch="Uniform">
|
|
<Grid>
|
|
<Grid>
|
|
- <Path Data="M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM10.5303 4.53038L8.06069 7L10.5303 9.46962L9.46967 10.5303L7.00002 8.06066L4.53033 10.5303L3.46967 9.46967L5.93936 7L3.46967 4.53033L4.53033 3.46967L7.00002 5.93934L9.46967 3.46971L10.5303 4.53038Z" Fill="#CED0D4"></Path>
|
|
|
|
|
|
+ <Path Data="M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM10.5303 4.53038L8.06069 7L10.5303 9.46962L9.46967 10.5303L7.00002 8.06066L4.53033 10.5303L3.46967 9.46967L5.93936 7L3.46967 4.53033L4.53033 3.46967L7.00002 5.93934L9.46967 3.46971L10.5303 4.53038Z" Fill="#CED0D4" />
|
|
</Grid>
|
|
</Grid>
|
|
</Viewbox>
|
|
</Viewbox>
|
|
</Grid>
|
|
</Grid>
|
|
@@ -75,45 +90,79 @@
|
|
</Setter>
|
|
</Setter>
|
|
</Style>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
</UserControl.Resources>
|
|
- <cus:DialogContent Header="Open Pasword" FontFamily="Segoe UI">
|
|
|
|
|
|
+ <cus:DialogContent FontFamily="Segoe UI" Header="Open Pasword">
|
|
<cus:DialogContent.Content>
|
|
<cus:DialogContent.Content>
|
|
- <Grid Margin="16,0,16,0" Width="400" MinHeight="106">
|
|
|
|
|
|
+ <Grid
|
|
|
|
+ Width="400"
|
|
|
|
+ MinHeight="106"
|
|
|
|
+ Margin="16,0,16,0">
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
- <ColumnDefinition Width="80"></ColumnDefinition>
|
|
|
|
- <ColumnDefinition></ColumnDefinition>
|
|
|
|
|
|
+ <ColumnDefinition Width="80" />
|
|
|
|
+ <ColumnDefinition />
|
|
</Grid.ColumnDefinitions>
|
|
</Grid.ColumnDefinitions>
|
|
- <Image Source="pack://application:,,,/Resources/Dialog/password.png" Margin="0,-20,0,0"></Image>
|
|
|
|
|
|
+ <Image Margin="0,-20,0,0" Source="pack://application:,,,/Resources/Dialog/password.png" />
|
|
<Grid Grid.Column="1" Margin="8,0,0,0">
|
|
<Grid Grid.Column="1" Margin="8,0,0,0">
|
|
<Grid.RowDefinitions>
|
|
<Grid.RowDefinitions>
|
|
- <RowDefinition MinHeight="44"></RowDefinition>
|
|
|
|
- <RowDefinition Height="40"></RowDefinition>
|
|
|
|
- <RowDefinition></RowDefinition>
|
|
|
|
|
|
+ <RowDefinition MinHeight="44" />
|
|
|
|
+ <RowDefinition Height="40" />
|
|
|
|
+ <RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0">
|
|
<Grid Grid.Row="0">
|
|
- <TextBlock TextWrapping="Wrap" Block.TextAlignment="Left" Text="{Binding InputPasswordMsg, Mode=TwoWay}" FontSize="14" FontFamily="Segoe UI"> </TextBlock>
|
|
|
|
|
|
+ <TextBlock
|
|
|
|
+ Block.TextAlignment="Left"
|
|
|
|
+ FontFamily="Segoe UI"
|
|
|
|
+ FontSize="14"
|
|
|
|
+ Text="{Binding InputPasswordMsg, Mode=TwoWay}"
|
|
|
|
+ TextWrapping="Wrap" />
|
|
</Grid>
|
|
</Grid>
|
|
- <Grid Grid.Row="1" Margin="0,8,0,0">
|
|
|
|
|
|
+ <Grid Grid.Row="1" Margin="0,8,0,0">
|
|
<Grid.ColumnDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
- <ColumnDefinition></ColumnDefinition>
|
|
|
|
- <ColumnDefinition Width="23"></ColumnDefinition>
|
|
|
|
|
|
+ <ColumnDefinition />
|
|
|
|
+ <ColumnDefinition Width="23" />
|
|
</Grid.ColumnDefinitions>
|
|
</Grid.ColumnDefinitions>
|
|
- <PasswordBox PasswordChar="*" Style="{StaticResource CheckPasswordBoxStyle}" help:PasswordBoxHelper.Password="{Binding Password, Mode=TwoWay , UpdateSourceTrigger=PropertyChanged}" help:PasswordBoxHelper.DisplayText="{Binding CheckPasswordMsg, Mode=TwoWay}" help:PasswordBoxHelper.IsRightValue="{Binding IsRightValue, Mode=TwoWay}" Grid.ColumnSpan="2"></PasswordBox>
|
|
|
|
- <Button Style="{StaticResource DeletePasswordButtonStyle}" Grid.Column="1" HorizontalAlignment="Left" Command="{Binding ClearPasswordCommand}" Visibility="{Binding ClearPasswordButtonVisibility, Mode=TwoWay}"></Button>
|
|
|
|
|
|
+ <PasswordBox
|
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
|
+ help:PasswordBoxHelper.DisplayText="{Binding CheckPasswordMsg, Mode=TwoWay}"
|
|
|
|
+ help:PasswordBoxHelper.IsRightValue="{Binding IsRightValue, Mode=TwoWay}"
|
|
|
|
+ help:PasswordBoxHelper.Password="{Binding Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
+ PasswordChar="*"
|
|
|
|
+ Style="{StaticResource CheckPasswordBoxStyle}" />
|
|
|
|
+ <Button
|
|
|
|
+ Grid.Column="1"
|
|
|
|
+ HorizontalAlignment="Left"
|
|
|
|
+ Command="{Binding ClearPasswordCommand}"
|
|
|
|
+ Style="{StaticResource DeletePasswordButtonStyle}"
|
|
|
|
+ Visibility="{Binding ClearPasswordButtonVisibility, Mode=TwoWay}" />
|
|
</Grid>
|
|
</Grid>
|
|
<Grid Grid.Row="2" Margin="0,2,0,0">
|
|
<Grid Grid.Row="2" Margin="0,2,0,0">
|
|
- <TextBlock Text="{Binding ErrorPasswordMsg, Mode=TwoWay}" Foreground="#F3465B" Visibility="{Binding ErrorPasswordMsgVisibility, Mode=TwoWay}"></TextBlock>
|
|
|
|
|
|
+ <TextBlock
|
|
|
|
+ Foreground="#F3465B"
|
|
|
|
+ Text="{Binding ErrorPasswordMsg, Mode=TwoWay}"
|
|
|
|
+ Visibility="{Binding ErrorPasswordMsgVisibility, Mode=TwoWay}" />
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</Grid>
|
|
</cus:DialogContent.Content>
|
|
</cus:DialogContent.Content>
|
|
<cus:DialogContent.BottmBar>
|
|
<cus:DialogContent.BottmBar>
|
|
<Grid Margin="16">
|
|
<Grid Margin="16">
|
|
- <StackPanel VerticalAlignment="Center" Height="32" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
|
|
- <Button Width="67" Margin="0,0,16,0" Style="{StaticResource Btn.cta}" Command="{Binding ConfirmCommand}">
|
|
|
|
- <TextBlock Text="Open"></TextBlock>
|
|
|
|
|
|
+ <StackPanel
|
|
|
|
+ Height="32"
|
|
|
|
+ HorizontalAlignment="Right"
|
|
|
|
+ VerticalAlignment="Center"
|
|
|
|
+ Orientation="Horizontal">
|
|
|
|
+ <Button
|
|
|
|
+ Width="67"
|
|
|
|
+ Margin="0,0,16,0"
|
|
|
|
+ Command="{Binding ConfirmCommand}"
|
|
|
|
+ IsDefault="True"
|
|
|
|
+ Style="{StaticResource Btn.cta}">
|
|
|
|
+ <TextBlock Text="Open" />
|
|
</Button>
|
|
</Button>
|
|
- <Button Width="67" Style="{StaticResource btn.ghost}" Command="{Binding CancelCommand}">
|
|
|
|
- <TextBlock Text="Cancel"></TextBlock>
|
|
|
|
|
|
+ <Button
|
|
|
|
+ Width="67"
|
|
|
|
+ Command="{Binding CancelCommand}"
|
|
|
|
+ Style="{StaticResource btn.sec}">
|
|
|
|
+ <TextBlock Text="Cancel" />
|
|
</Button>
|
|
</Button>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|