有没有办法Focus
使用 WPF 从一个控件设置到另一个控件Trigger
?
像下面的例子:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBox Name="txtName"></TextBox>
<TextBox Grid.Row="1" Name="txtAddress"></TextBox>
<Button Grid.Row="2" Content="Finish">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<!-- Insert cool code here-->
</EventTrigger>
</Button.Triggers>
</Button>
</Grid>
</Page>
有没有办法EventTrigger
把注意力集中在文本框“txtName”上?
我正在尝试找到使用严格 MVVM 执行此类操作的方法。如果这是不应该通过 XAML(在 MVVM 中)完成的事情,那很好。但我希望看到一些关于它如何适应 MVVM 模式的文档,在 XAML 之外执行它。