File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,27 @@ public AppViewModel(IWindowSwitcher _switcher)
5454 {
5555 System . Diagnostics . Process . Start ( "https://github.com/balazs4/windowswitcher/" ) ;
5656 } ) ;
57+
58+ SelectPrev = new LambdaCommand ( _ =>
59+ {
60+ if ( ! Windows . MoveCurrentToPrevious ( ) )
61+ {
62+ //hacky tracky workaround works :D
63+ Windows . MoveCurrentToNext ( ) ;
64+ }
65+ RaisePropertyChangedEvent ( "Windows" ) ;
66+ } ) ;
67+
68+ SelectNext = new LambdaCommand ( _ =>
69+ {
70+ if ( ! Windows . MoveCurrentToNext ( ) )
71+ {
72+ //hacky tracky workaround works :D
73+ Windows . MoveCurrentToPrevious ( ) ;
74+ }
75+ RaisePropertyChangedEvent ( "Windows" ) ;
76+ }
77+ ) ;
5778 }
5879
5980 public string Title { get ; private set ; }
@@ -104,6 +125,10 @@ public ICollectionView Windows
104125 }
105126
106127
128+ public ICommand SelectNext { get ; private set ; }
129+
130+ public ICommand SelectPrev { get ; private set ; }
131+
107132 public ICommand Activate { get ; private set ; }
108133 public ICommand OpenLink { get ; private set ; }
109134 }
Original file line number Diff line number Diff line change 5252 BorderThickness =" 0"
5353 Background =" {x:Static SystemColors.WindowBrush}"
5454 Foreground =" {x:Static SystemColors.ControlTextBrush}"
55- Text =" {Binding SearchText, UpdateSourceTrigger=PropertyChanged}" />
55+ Text =" {Binding SearchText, UpdateSourceTrigger=PropertyChanged}" >
56+ <TextBox .InputBindings>
57+ <KeyBinding Key =" Up" Command =" {Binding Path=SelectPrev}" />
58+ <KeyBinding Key =" Down" Command =" {Binding Path=SelectNext}" />
59+ </TextBox .InputBindings>
60+ </TextBox >
5661 </Grid >
5762 <ListView Grid.Row=" 2"
5863 Margin =" 2,16"
6570 ScrollViewer.VerticalScrollBarVisibility=" Disabled"
6671 ScrollViewer.HorizontalScrollBarVisibility=" Hidden"
6772 Opacity =" 0.8" >
73+ <ListView .InputBindings>
74+ <KeyBinding Key =" Up" Command =" {Binding Path=SelectPrev}" />
75+ <KeyBinding Key =" Down" Command =" {Binding Path=SelectNext}" />
76+ </ListView .InputBindings>
6877 <ListView .ItemTemplate>
6978 <DataTemplate >
7079 <TextBlock
You can’t perform that action at this time.
0 commit comments