Describe the bug
使用 FocusManager.FocusedElement 没有办法让 NumericUpDown 一开始就聚焦
Steps to reproduce the bug
代码
<Window
x:Class="WpfApp6.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:WpfApp6"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="450"
FocusManager.FocusedElement="{Binding ElementName=Input}"
mc:Ignorable="d">
<Grid>
<hc:NumericUpDown
x:Name="Input" Focusable="True"
Width="120"
VerticalAlignment="Center" />
</Grid>
</Window>
Expected behavior
应该会在窗口打开时自动聚焦到文本框
Screenshots
No response
NuGet package version
HandyControl 3.5.1
IDE
Visual Studio 2022-preview
Framework type
.Net 9.0
Windows version
No response
Additional context
No response
Describe the bug
使用 FocusManager.FocusedElement 没有办法让 NumericUpDown 一开始就聚焦
Steps to reproduce the bug
代码
Expected behavior
应该会在窗口打开时自动聚焦到文本框
Screenshots
No response
NuGet package version
HandyControl 3.5.1
IDE
Visual Studio 2022-preview
Framework type
.Net 9.0
Windows version
No response
Additional context
No response