예제 #1
0
파일: MainForm.cs 프로젝트: pcdummy/Eto
        public MainForm(IEnumerable <Section> topNodes = null)
        {
            this.Title       = "Test Application";
            this.Style       = "main";
            this.SectionList = new SectionList(topNodes ?? TestSectionList.TopNodes());

#if DESKTOP
            this.Icon       = TestIcons.TestIcon;
            this.ClientSize = new Size(900, 650);
#endif
            //this.Opacity = 0.5;

#if DESKTOP
            HandleEvent(MainForm.WindowStateChangedEvent);
#endif
            HandleEvent(MainForm.ClosedEvent, MainForm.ClosingEvent);

            /* Option 1: use actions to generate menu and toolbar (recommended)
             */
            GenerateMenuToolBarActions();


            /* Option 2: generate menu and toolbar directly
             *
             * GenerateMenu();
             *
             * GenerateToolBar();
             * /*
             */

            Content = MainContent();
        }
예제 #2
0
        public MainForm(IEnumerable <Section> topNodes = null)
        {
            this.Title = "Test Application";
            this.Style = "main";
            //this.SectionList = new SectionListGridView(topNodes ?? TestSectionList.TopNodes());
            //this.SectionList = new SectionListTreeView(topNodes ?? TestSectionList.TopNodes());
#if ANDROID
            this.SectionList = new SectionListGridView(topNodes ?? TestSectionList.TopNodes());
#else
            this.SectionList = new SectionListTreeGridView(topNodes ?? TestSectionList.TopNodes());
#endif

#if DESKTOP
            this.Icon       = TestIcons.TestIcon();
            this.ClientSize = new Size(900, 650);
#endif
            //this.Opacity = 0.5;

            // Commenting the next line on iOS displays just the toolbar. Otherwise it is hidden for some reason.
            Content = MainContent();

            GenerateMenuToolBar();
        }