修正PanelLocker和PanelLockerPasswordChanger控件显示后焦点没有自动设置在密码输入框中的问题。
This commit is contained in:
parent
860b96e242
commit
0d85a7840a
|
@ -24,7 +24,6 @@
|
|||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
MaxLength="15" Grid.Row="1"
|
||||
FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}"
|
||||
PreviewKeyDown="TxtPass_OnPreviewKeyDown"/>
|
||||
<TextBlock x:Name="txtInfo" Grid.Row="2" Grid.ColumnSpan="3" FontSize="9" HorizontalAlignment="Center" Margin="0,5,0,0" FontStyle="Italic" Foreground="Red"/>
|
||||
<Button
|
||||
|
|
|
@ -66,6 +66,19 @@ namespace MECF.Framework.UI.Client.Ctrlib.Controls
|
|||
Dispatcher.Invoke(Lock);
|
||||
return true;
|
||||
}, "AutoLockRecipeEditor");
|
||||
|
||||
Loaded += (sender, args) =>
|
||||
{
|
||||
txtPass.Focus();
|
||||
};
|
||||
|
||||
IsVisibleChanged += (sender, args) =>
|
||||
{
|
||||
if (args.NewValue is bool isVis && isVis)
|
||||
{
|
||||
txtPass.Focus();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#region Dps
|
||||
|
@ -132,6 +145,8 @@ namespace MECF.Framework.UI.Client.Ctrlib.Controls
|
|||
|
||||
#region Methods
|
||||
|
||||
|
||||
|
||||
public void Lock()
|
||||
{
|
||||
txtPass.Password = "";
|
||||
|
@ -263,8 +278,5 @@ namespace MECF.Framework.UI.Client.Ctrlib.Controls
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -39,7 +39,7 @@
|
|||
<TextBlock Grid.Row="1" Text="New Password"/>
|
||||
<TextBlock Grid.Row="2" Text="Confirm Password"/>
|
||||
|
||||
<PasswordBox x:Name="txtOldPass" Grid.Row="0" Grid.Column="1" FocusManager.FocusedElement="{Binding RelativeSource={RelativeSource Self}}"/>
|
||||
<PasswordBox x:Name="txtOldPass" Grid.Row="0" Grid.Column="1" />
|
||||
<PasswordBox x:Name="txtNewPass" Grid.Row="1" Grid.Column="1" />
|
||||
<PasswordBox x:Name="txtConfirmPass" Grid.Row="2" Grid.Column="1" />
|
||||
|
||||
|
|
|
@ -23,6 +23,11 @@ namespace MECF.Framework.UI.Client.Ctrlib.Controls
|
|||
public PanelLockerPasswordChanger()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Loaded += (sender, args) =>
|
||||
{
|
||||
txtOldPass.Focus();
|
||||
};
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, RoutedEventArgs e)
|
||||
|
|
Loading…
Reference in New Issue