123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <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.Resources>
- <Style TargetType="PasswordBox" x:Key="CheckPasswordBoxStyle">
- <Setter Property="Height" Value="32"/>
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="PasswordBox">
- <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Background="{TemplateBinding Background}"
- SnapsToDevicePixels="True"
- CornerRadius="5">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition Width="24"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <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"/>
- </Grid>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Opacity" TargetName="border" Value="0.56"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="true">
- <Setter Property="BorderBrush" TargetName="border" Value="#1770F4"/>
- </Trigger>
- <DataTrigger Binding="{Binding Path = Password}" Value="">
- <Setter Property="Visibility" TargetName="markText" Value="Visible"/>
- </DataTrigger>
- <DataTrigger Binding="{Binding Path=IsRightValue}" Value="false">
- <Setter Property="BorderBrush" TargetName="border" Value="#F3465B"/>
- </DataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </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>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ButtonBase}">
- <Grid>
- <Viewbox Stretch="Uniform">
- <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>
- </Grid>
- </Viewbox>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <cus:DialogContent Header="Open Pasword" FontFamily="Segoe UI">
- <cus:DialogContent.Content>
- <Grid Margin="16,0,16,0" Width="400" MinHeight="106">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="80"></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Image Source="pack://application:,,,/Resources/Dialog/password.png" Margin="0,-20,0,0"></Image>
- <Grid Grid.Column="1" Margin="8,0,0,0">
- <Grid.RowDefinitions>
- <RowDefinition MinHeight="44"></RowDefinition>
- <RowDefinition Height="40"></RowDefinition>
- <RowDefinition></RowDefinition>
- </Grid.RowDefinitions>
- <Grid Grid.Row="0">
- <TextBlock TextWrapping="Wrap" Block.TextAlignment="Left" Text="{Binding InputPasswordMsg, Mode=TwoWay}" FontSize="14" FontFamily="Segoe UI"> </TextBlock>
- </Grid>
- <Grid Grid.Row="1" Margin="0,8,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition Width="23"></ColumnDefinition>
- </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>
- </Grid>
- <Grid Grid.Row="2" Margin="0,2,0,0">
- <TextBlock Text="{Binding ErrorPasswordMsg, Mode=TwoWay}" Foreground="#F3465B" Visibility="{Binding ErrorPasswordMsgVisibility, Mode=TwoWay}"></TextBlock>
- </Grid>
- </Grid>
- </Grid>
- </cus:DialogContent.Content>
- <cus:DialogContent.BottmBar>
- <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>
- </Button>
- <Button Width="67" Style="{StaticResource btn.ghost}" Command="{Binding CancelCommand}">
- <TextBlock Text="Cancel"></TextBlock>
- </Button>
- </StackPanel>
- </Grid>
- </cus:DialogContent.BottmBar>
- </cus:DialogContent>
- </UserControl>
|