本文整理汇总了C#中System.Windows.Input.KeyboardFocusChangedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# KeyboardFocusChangedEventArgs类的具体用法?C# KeyboardFocusChangedEventArgs怎么用?C# KeyboardFocusChangedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KeyboardFocusChangedEventArgs类属于System.Windows.Input命名空间,在下文中一共展示了KeyboardFocusChangedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnGotKeyboardFocus
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
if (Model != null)
Model.IsActive = true;
base.OnGotKeyboardFocus(e);
}
示例2: OnLostKeyboardFocus
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
txtReadOnly.Visibility = Visibility.Visible;
txtEdit.Visibility = Visibility.Collapsed;
Text = EditedText;
base.OnLostKeyboardFocus(e);
}
示例3: projectTextBox_OnLostKeyboardFocus
private void projectTextBox_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (!string.IsNullOrEmpty(this.selectedProject.ProjectLabel))
{
this.selectProject(this.selectedProject);
}
}
示例4: Window_LostKeyboardFocus
private void Window_LostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (!closing)
{
this.Close();
}
}
示例5: ValidDateTextBox_PreviewLostKeyboardFocus
private void ValidDateTextBox_PreviewLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (HasError)
{
e.Handled = true;
}
}
示例6: OnGotKeyboardFocus
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
if (this.IsKeyboardFocusWithin)
{
this.lastElementWithFocus = e.NewFocus as FrameworkElement;
}
}
示例7: OnGotKeyboardFocus
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
if ((e.OldFocus is DataGridCell)) return;
Keyboard.Focus(_lastDataGridFocus);
if (SelectedIndex == -1 && Items.Count > 0) SelectedIndex = 0;
e.Handled = true;
}
示例8: tbName_GotKeyboardFocus
private void tbName_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (tbName.Text == "Имя")
{
tbName.Text = "";
}
}
示例9: OnGotKeyboardFocus
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
if (SelectAllOnGotFocus)
SelectAll();
base.OnGotKeyboardFocus(e);
}
示例10: txtMyProfile_GotKeyboardFocus
private void txtMyProfile_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (txtMyProfile.Text == DefaultTextMySteamProfile)
{
txtMyProfile.Clear();
}
}
示例11: OnKeyboardFocus
void OnKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (e.NewFocus == this)
{
terminalControl.Focus();
Keyboard.Focus(terminalControl);
}
}
示例12: OnGotKeyboardFocus
/// Forward focus to TextArea.
/// <inheritdoc/>
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
base.OnGotKeyboardFocus(e);
if (e.NewFocus == this) {
Keyboard.Focus(this.TextArea);
e.Handled = true;
}
}
示例13: OnGotKeyboardFocus
private void OnGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{
if (e.OldFocus is MenuItem)
{
return;
}
SelectTextInTextBox(sender);
}
示例14: OnGotKeyboardFocus
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
base.OnGotKeyboardFocus(e);
if (this.SelectedIndex == -1)
{
this.SelectedIndex = 0;
}
}
示例15: OnLostKeyboardFocus
protected override void OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)
{
base.OnLostKeyboardFocus(e);
if (IsKeyboardFocusWithin)
return;
if (IsOpen)
Child.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
}