Skip to content

Commit

Permalink
Enrich event bindings example with KeyBinding
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored and TysonMN committed Mar 12, 2021
1 parent 66cf956 commit 167bdb1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Samples/EventBindingsAndBehaviors/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
WindowStartupLocation="CenterScreen"
mc:Ignorable="d"
d:DataContext="{x:Static vm:Program.designVm}">
<Window.InputBindings>
<KeyBinding Command="{Binding ToggleVisibility}" Gesture="Ctrl+T" />
</Window.InputBindings>
<StackPanel Margin="15" HorizontalAlignment="Center">
<TextBlock Text="Switch focus between these two inputs." Margin="0,0,0,10" TextAlignment="Center" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
Expand Down Expand Up @@ -42,7 +45,14 @@
<TextBlock Text="{Binding Msg2}" Margin="0,0,25,0" TextAlignment="Center" />
</StackPanel>
</StackPanel>
<Button Command="{Binding ToggleVisibility}" Content="{Binding ButtonText}" Width="100" Height="25" Margin="0,20,0,0"/>
<Button Command="{Binding ToggleVisibility}" Content="{Binding ButtonText}" Width="100" Height="25" Margin="0,20,0,0">
<Button.ToolTip>
<TextBlock>
<Run Text="{Binding ButtonText}" />
<Run Text="(Ctrl + T)" />
</TextBlock>
</Button.ToolTip>
</Button>
<TextBlock
Text="This input will receive focus automatically each time it appears."
TextWrapping="Wrap"
Expand Down

0 comments on commit 167bdb1

Please sign in to comment.