mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 00:24:59 +00:00
refactor<WorkingCopyChanges>: use PreviewKeyDown instead of RoutedUICommand for staging/unstaging hot keys
This commit is contained in:
parent
208af69ea1
commit
62c182f5ca
3 changed files with 35 additions and 41 deletions
|
@ -25,22 +25,8 @@
|
|||
MultiSelection="True"
|
||||
ItemsSource="{Binding ElementName=me, Path=Nodes}"
|
||||
SelectionChanged="OnTreeSelectionChanged"
|
||||
PreviewKeyDown="OnChangePreviewKeyDown"
|
||||
Visibility="Visible">
|
||||
<TreeView.Resources>
|
||||
<RoutedUICommand x:Key="SelectWholeTreeCommand" Text="SelectWholeTree"/>
|
||||
<RoutedUICommand x:Key="StageChangeCommand" Text="StageChange"/>
|
||||
</TreeView.Resources>
|
||||
|
||||
<TreeView.InputBindings>
|
||||
<KeyBinding Key="A" Modifiers="Ctrl" Command="{StaticResource SelectWholeTreeCommand}"/>
|
||||
<KeyBinding Key="Space" Command="{StaticResource StageChangeCommand}"/>
|
||||
</TreeView.InputBindings>
|
||||
|
||||
<TreeView.CommandBindings>
|
||||
<CommandBinding Command="{StaticResource SelectWholeTreeCommand}" Executed="SelectWholeTree"/>
|
||||
<CommandBinding Command="{StaticResource StageChangeCommand}" Executed="StageChange"/>
|
||||
</TreeView.CommandBindings>
|
||||
|
||||
<controls:Tree.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type controls:TreeItem}" BasedOn="{StaticResource Style.TreeItem}">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
|
||||
|
@ -95,6 +81,7 @@
|
|||
SelectionUnit="FullRow"
|
||||
SelectionChanged="OnListSelectionChanged"
|
||||
SizeChanged="OnListSizeChanged"
|
||||
PreviewKeyDown="OnChangePreviewKeyDown"
|
||||
ItemsSource="{Binding ElementName=me, Path=Changes}"
|
||||
RowStyle="{StaticResource Style.DataGridRow.Change}"
|
||||
Visibility="Collapsed">
|
||||
|
@ -123,6 +110,7 @@
|
|||
SelectionUnit="FullRow"
|
||||
SelectionChanged="OnGridSelectionChanged"
|
||||
SizeChanged="OnGridSizeChanged"
|
||||
PreviewKeyDown="OnChangePreviewKeyDown"
|
||||
ItemsSource="{Binding ElementName=me, Path=Changes}"
|
||||
RowStyle="{StaticResource Style.DataGridRow.Change}"
|
||||
Visibility="Collapsed">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue