@@ -28,18 +28,54 @@ public class TabView : View
28
28
public TabView ( )
29
29
{
30
30
CanFocus = true ;
31
- TabStop = TabBehavior . TabStop ; // Because TabView has focusable subviews, it must be a TabGroup
32
- _tabsBar = new TabRow ( this ) ;
31
+ TabStop = TabBehavior . TabStop ;
32
+ _tabsBar = new ( this ) ;
33
33
_containerView = new ( ) ;
34
34
ApplyStyleChanges ( ) ;
35
35
36
36
base . Add ( _tabsBar ) ;
37
37
base . Add ( _containerView ) ;
38
38
39
39
// Things this view knows how to do
40
- AddCommand ( Command . Left , ( ) => SwitchTabBy ( - 1 ) ) ;
41
-
42
- AddCommand ( Command . Right , ( ) => SwitchTabBy ( 1 ) ) ;
40
+ AddCommand ( Command . Left , ( ) =>
41
+ {
42
+ if ( Style . TabsSide is TabSide . Top or TabSide . Bottom )
43
+ {
44
+ return SwitchTabBy ( - 1 ) ;
45
+ }
46
+
47
+ return false ;
48
+ } ) ;
49
+
50
+ AddCommand ( Command . Right , ( ) =>
51
+ {
52
+ if ( Style . TabsSide is TabSide . Top or TabSide . Bottom )
53
+ {
54
+ return SwitchTabBy ( 1 ) ;
55
+ }
56
+
57
+ return false ;
58
+ } ) ;
59
+
60
+ AddCommand ( Command . Up , ( ) =>
61
+ {
62
+ if ( Style . TabsSide is TabSide . Left or TabSide . Right )
63
+ {
64
+ return SwitchTabBy ( - 1 ) ;
65
+ }
66
+
67
+ return false ;
68
+ } ) ;
69
+
70
+ AddCommand ( Command . Down , ( ) =>
71
+ {
72
+ if ( Style . TabsSide is TabSide . Left or TabSide . Right )
73
+ {
74
+ return SwitchTabBy ( 1 ) ;
75
+ }
76
+
77
+ return false ;
78
+ } ) ;
43
79
44
80
AddCommand (
45
81
Command . LeftStart ,
@@ -174,6 +210,8 @@ public TabView ()
174
210
// Default keybindings for this view
175
211
KeyBindings . Add ( Key . CursorLeft , Command . Left ) ;
176
212
KeyBindings . Add ( Key . CursorRight , Command . Right ) ;
213
+ KeyBindings . Add ( Key . CursorUp , Command . Up ) ;
214
+ KeyBindings . Add ( Key . CursorDown , Command . Down ) ;
177
215
KeyBindings . Add ( Key . Home , Command . LeftStart ) ;
178
216
KeyBindings . Add ( Key . End , Command . RightEnd ) ;
179
217
KeyBindings . Add ( Key . PageDown , Command . PageDown ) ;
0 commit comments