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