我是 MVVM 世界的新手,我有一个 XAMl
<UserControl x:Class="KeyDownMVVM.MainPage"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="186,125,0,0" Name="button1" VerticalAlignment="Top" Width="75" />
</Grid>
</UserControl>
我想处理 userlcontrol keydown 事件来捕捉键盘修饰符和键,但使用 MVVM 模式有任何想法。我使用银光 4 。大部分教程都讲具体的控制