File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77// You can make changes to this file and they will not be overwritten when saving.
88// </auto-generated>
99// -----------------------------------------------------------------------------
10- namespace Showcase {
10+ namespace Showcase {
1111 using Terminal . Gui ;
1212
1313
Original file line number Diff line number Diff line change 1- using System . Collections . ObjectModel ;
2- using System . Runtime . InteropServices . ComTypes ;
3- using Terminal . Gui ;
4- using Terminal . Gui . App ;
5- using Terminal . Gui . Drivers ;
6- using Terminal . Gui . ViewBase ;
7- using Terminal . Gui . Views ;
1+ using Terminal . Gui . App ;
82
93namespace Showcase
104{
115 internal class Program
126 {
13- private static Type [ ] views = new [ ]
14- {
15- typeof ( Menus ) ,
16- typeof ( Tabs )
17-
18- } ;
197 static void Main ( string [ ] args )
208 {
21- Application . Init ( ) ;
22-
23- var w = new Window ( )
24- {
25- Title = "Showcase"
26- } ;
27-
28- var lv = new ListView ( )
29- {
30- Width = Dim . Fill ( ) ,
31- Height = Dim . Fill ( ) ,
32- } ;
33- w . Add ( lv ) ;
34- lv . SetSource ( new ObservableCollection < Type > ( views ) ) ;
35-
36-
37- lv . KeyDown += ( _ , e ) =>
9+ using ( var app = Application . Create ( ) )
3810 {
39- if ( e . KeyCode == KeyCode . Enter )
40- {
41- var v = ( Toplevel ) Activator . CreateInstance ( views [ lv . SelectedItem ] ) ;
42- e . Handled = true ;
43- Application . Run ( v ) ;
44- }
45- } ;
46-
47- Application . Run ( w ) ;
48- Application . Shutdown ( ) ;
11+ app . Run < Menus > ( ) ;
12+ }
4913 }
5014 }
5115}
You can’t perform that action at this time.
0 commit comments