<UserControl x:Class="XHandler.View.User.ResetPassword"
|
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:XHandler.View.User"
|
xmlns:str="clr-namespace:XHandler.Properties"
|
xmlns:ctrl="clr-namespace:XHandler.Controls"
|
mc:Ignorable="d"
|
d:DesignHeight="450" d:DesignWidth="800" Loaded="UserControl_Loaded">
|
<UserControl.Resources>
|
<Style x:Key="ToggleButtonStyle" TargetType="ToggleButton">
|
<Setter Property="Margin" Value="5,0"></Setter>
|
<Setter Property="Background" Value="Transparent"></Setter>
|
<Setter Property="BorderThickness" Value="0"></Setter>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="ToggleButton">
|
<Grid Background="{TemplateBinding Background}">
|
<Image x:Name="IconImage" Source="pack://application:,,,/HxUserManagement;component/Assets/eyeoff.png"></Image>
|
<Image x:Name="IconImageOn" Source="pack://application:,,,/HxUserManagement;component/Assets/eyeon.png" Visibility="Hidden"></Image>
|
</Grid>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsChecked" Value="True">
|
<Setter TargetName="IconImageOn" Property="Visibility" Value="Visible"></Setter>
|
<Setter TargetName="IconImage" Property="Visibility" Value="Hidden"></Setter>
|
</Trigger>
|
<Trigger Property="IsChecked" Value="False">
|
<Setter TargetName="IconImage" Property="Visibility" Value="Visible"></Setter>
|
<Setter TargetName="IconImageOn" Property="Visibility" Value="Hidden"></Setter>
|
</Trigger>
|
<!--<Trigger Property="IsMouseOver" Value="True">
|
<Setter TargetName="IconImage" Property="Source" Value="pack://application:,,,/HxUserManagement;component/Assets/eyeon.png"></Setter>
|
</Trigger>-->
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
<Style TargetType="PasswordBox">
|
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
|
<Setter Property="Padding" Value="5,0"></Setter>
|
<Setter Property="Template">
|
<Setter.Value>
|
<ControlTemplate TargetType="PasswordBox">
|
<Border Background="{TemplateBinding Background}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
CornerRadius="4">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="*"></ColumnDefinition>
|
<ColumnDefinition Width="32"></ColumnDefinition>
|
</Grid.ColumnDefinitions>
|
<ScrollViewer Grid.Column="0" x:Name="PART_ContentHost"></ScrollViewer>
|
<TextBlock Grid.Column="0" x:Name="MessageTextBlock"
|
Text="{TemplateBinding Tag}"
|
FontSize="{TemplateBinding FontSize}"
|
Foreground="{TemplateBinding Foreground}"
|
Padding="{TemplateBinding Padding}"
|
VerticalAlignment="Center"
|
Visibility="Hidden"></TextBlock>
|
<TextBox Grid.Column="0" VerticalContentAlignment="Center"
|
BorderThickness="0" Visibility="Hidden"
|
FontSize="{TemplateBinding FontSize}"
|
Foreground="{TemplateBinding Foreground}"
|
Margin="{TemplateBinding Padding}"
|
Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=PasswordBox}, Path=(ctrl:PasswordBoxAttached.Password)}"
|
x:Name="PasswordTextBox"></TextBox>
|
<ToggleButton Grid.Column="1" x:Name="CheckedToggleButton" Focusable="False"
|
Style="{StaticResource ToggleButtonStyle}"></ToggleButton>
|
</Grid>
|
</Border>
|
<ControlTemplate.Triggers>
|
<Trigger Property="IsFocused" Value="True">
|
<Setter Property="BorderBrush" Value="{DynamicResource BrushPrimary}"></Setter>
|
</Trigger>
|
<Trigger Property="IsMouseOver" Value="True">
|
<Setter Property="BorderBrush" Value="{DynamicResource BrushPrimary}"></Setter>
|
</Trigger>
|
<!--<MultiTrigger>
|
<MultiTrigger.Conditions>
|
<Condition Property="IsKeyboardFocused" Value="False"></Condition>
|
<Condition Property="ctrl:PasswordBoxAttached.Password" Value=""></Condition>
|
</MultiTrigger.Conditions>
|
<Setter TargetName="MessageTextBlock" Property="Visibility" Value="Visible"></Setter>
|
<Setter TargetName="MessageTextBlock" Property="Opacity" Value="0.5"></Setter>
|
</MultiTrigger>-->
|
<DataTrigger Binding="{Binding ElementName=CheckedToggleButton, Path=IsChecked}" Value="True">
|
<Setter TargetName="PasswordTextBox" Property="Visibility" Value="Visible"></Setter>
|
<Setter TargetName="PART_ContentHost" Property="Visibility" Value="Hidden"></Setter>
|
</DataTrigger>
|
<DataTrigger Binding="{Binding ElementName=CheckedToggleButton, Path=IsChecked}" Value="Flase">
|
<Setter TargetName="PasswordTextBox" Property="Visibility" Value="Hidden"></Setter>
|
<Setter TargetName="PART_ContentHost" Property="Visibility" Value="Visible"></Setter>
|
</DataTrigger>
|
</ControlTemplate.Triggers>
|
</ControlTemplate>
|
</Setter.Value>
|
</Setter>
|
</Style>
|
</UserControl.Resources>
|
|
<Grid x:Name="root" Background="#01FFFFFF" PreviewMouseDown="root_PreviewMouseDown">
|
<Border x:Name="border" Width="0" Visibility="Collapsed" HorizontalAlignment="Right" Background="White" BorderBrush="LightGray"
|
BorderThickness="1">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="50"/>
|
<RowDefinition Height="20"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="30"/>
|
<RowDefinition Height="30"/>
|
<RowDefinition Height="40"/>
|
<RowDefinition Height="30"/>
|
<RowDefinition Height="30"/>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="200"/>
|
</Grid.RowDefinitions>
|
<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
<TextBlock x:Name="title" Text="{x:Static str:UserResource.strPSWDReset}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0" FontSize="20"
|
Foreground="Black" FontWeight="Bold"/>
|
<Button Content="×" HorizontalAlignment="Right" VerticalAlignment="Center" VerticalContentAlignment="Center" Margin="10 0" FontSize="28" Width="40" Height="40"
|
FontWeight="Bold" Foreground="Black" Style="{DynamicResource BlueButtonStyle}" Background="White" Click="Button_Click" BorderThickness="0"/>
|
<Rectangle Height="1" Fill="Gray" VerticalAlignment="Bottom" Margin="15 0"/>
|
</Grid>
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="{x:Static str:UserResource.strNewPassword}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
<!--<TextBox x:Name="textboxNewPswd" Grid.Row="2" Grid.Column="1" Height="35" VerticalContentAlignment="Center" HorizontalAlignment="Stretch"
|
VerticalAlignment="Center" FontSize="16" Margin="10 0 100 0" TextChanged="textboxNewPswd_TextChanged" BorderBrush="DarkGray"
|
Text="" LostFocus="textboxNewPswd_LostFocus"/>-->
|
<PasswordBox x:Name="textboxNewPswd" Grid.Row="2" Grid.Column="1" Height="35" VerticalContentAlignment="Center" HorizontalAlignment="Stretch"
|
VerticalAlignment="Center" FontSize="16" Margin="10 0 100 0" BorderBrush="DarkGray"
|
PasswordChanged="textboxNewPswd_PasswordChanged" Visibility="Visible"/>
|
<StackPanel Name="stkPwdkeyStrongth" Grid.Row="3" Orientation="Horizontal" Visibility="Collapsed">
|
<Button x:Name="lessPwd" Width="100" BorderThickness="0" Background="Red"></Button>
|
<TextBlock Text="|" Margin="10,0,10,0"></TextBlock>
|
<Border x:Name="midPwd" Width="100" BorderThickness="0" Background="Orange"></Border>
|
<TextBlock Text="|" Margin="10,0,10,0"></TextBlock>
|
<Border x:Name="strongPwd" Width="100" BorderThickness="0" Background="Green"></Border>
|
</StackPanel>
|
<TextBlock x:Name="pswdTips" Grid.Row="4" Grid.Column="1" Text="" FontSize="14" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10 0"
|
Foreground="Red" Visibility="Collapsed"/>
|
|
<TextBlock Grid.Row="5" Grid.Column="0" Text="{x:Static str:UserResource.strConfirmPassword}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
<!--<TextBox x:Name="textboxConfirmPswd" Grid.Row="4" Grid.Column="1" Height="35" VerticalContentAlignment="Center" HorizontalAlignment="Stretch"
|
VerticalAlignment="Center" FontSize="16" Margin="10 0 100 0" MaxLength="11" TextChanged="textboxConfirmPswd_TextChanged" BorderBrush="DarkGray"
|
Text="" LostFocus="textboxConfirmPswd_LostFocus"/>-->
|
<PasswordBox x:Name="textboxConfirmPswd" Grid.Row="5" Grid.Column="1" Height="35" VerticalContentAlignment="Center" HorizontalAlignment="Stretch"
|
VerticalAlignment="Center" FontSize="16" Margin="10 0 100 0" BorderBrush="DarkGray"
|
PasswordChanged="textboxConfirmPswd_PasswordChanged" Visibility="Visible"/>
|
<StackPanel Name="stkPwdkey" Grid.Row="6">
|
<!--<ProgressBar x:Name="lessPwd" Value="0" Maximum="1" Minimum="0" Width="100" Background="LightGreen"></ProgressBar>
|
<TextBlock Text="|" Margin="10,0,10,0"></TextBlock>
|
<ProgressBar x:Name="midPwd" Value="0" Maximum="1" Minimum="0" Width="100" Background="LightYellow"></ProgressBar>
|
<TextBlock Text="|" Margin="10,0,10,0"></TextBlock>
|
<ProgressBar x:Name="strongPwd" Value="0" Maximum="1" Minimum="0" Width="100" Background="Red"></ProgressBar>-->
|
</StackPanel>
|
<TextBlock x:Name="pswdConfirmTips" Grid.Row="7" Grid.Column="1" Text="" FontSize="14" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10 0"
|
Foreground="Red" Visibility="Collapsed"/>
|
|
|
<Button Content="{x:Static str:UserResource.strCancel}" x:Name="btnCancel" Grid.Row="9" Grid.Column="1" HorizontalAlignment="Right"
|
Foreground="Black" Style="{DynamicResource BlueButtonStyle}" Background="White" BorderThickness="1" BorderBrush="Black"
|
Height="40" Width="100" Click="btnCancel_Click" FontSize="16" Margin="0 0 150 0" />
|
|
<Button Content="{x:Static str:UserResource.strSave}" x:Name="btnSave" Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right"
|
Foreground="White" Style="{DynamicResource BlueButtonStyle}" Background="{DynamicResource blueBrush}" BorderThickness="0"
|
Height="40" Width="100" Click="btnSave_Click" FontSize="16" Margin="0 0 20 0"/>
|
|
|
</Grid>
|
</Border>
|
</Grid>
|
</UserControl>
|