mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
FZE: Fix dialog number box input automation name (#12718)
This commit is contained in:
@@ -491,5 +491,15 @@ namespace FancyZonesEditor
|
||||
_backup = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void NumberBox_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// The TextBox inside a NumberBox doesn't inherit the Automation Properties name, so we have to set it.
|
||||
var numberBox = sender as NumberBox;
|
||||
const string numberBoxTextBoxName = "InputBox"; // Text box template part name given by ModernWPF.
|
||||
numberBox.ApplyTemplate(); // Apply template to be able to change child's property.
|
||||
var numberBoxTextBox = numberBox.Template.FindName(numberBoxTextBoxName, numberBox) as TextBox;
|
||||
numberBoxTextBox.SetValue(AutomationProperties.NameProperty, numberBox.GetValue(AutomationProperties.NameProperty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user