Exemplo n.º 1
0
        /*public WPF_GUI buildGui(List<WPF_GUI_Section> sections)
         * {
         *      Sections = sections;
         *      return buildGui();
         * }*/
        public WPF_GUI buildGui()
        {
            return((WPF_GUI)this.invokeOnThread(
                       () => {
                this.backColor(Color.White);

                var wpfHost = this.add_WpfHost();

                var dockPanel = wpfHost.add_Control_Wpf <DockPanel>();
                GUI_OutlookBar = dockPanel.add_Control_Wpf <OutlookBar>();
                GUI_OutlookBar.IsButtonSplitterVisible = false;
                GUI_OutlookBar.IsOverflowVisible = true;
                GUI_OutlookBar.IsPopupVisible = true;
                GUI_OutlookBar.ShowSideButtons = true;
                GUI_OutlookBar.ShowButtons = true;
                GUI_OutlookBar.Width = SideBarWidth;
                //GUI_OutlookBar.MaxWidth = SideBarWidth;
                GUI_OutlookBar.ButtonHeight = 21;

                var userControl = dockPanel.add_WinForms_Panel()
                                  .add_Control <WinForms.UserControl>();
                StatusLabel = userControl.add_StatusStrip(Color.White);
                WinFormPanel = userControl.add_Panel();

                O2Browser = WinFormPanel.add_WebBrowser();

                /*O2Browser.fill(false)
                 *               .align_Right(userControl)
                 *               .align_Bottom(userControl)
                 *               .heightAdd(-22)
                 *       .anchor_All()
                 *       .silent(true);		*/

                WinFormPanel.fill(false)
                .align_Right(userControl)
                .align_Bottom(userControl)
                .heightAdd(-22)
                .anchor_All();

                statusMessage("WPF GUI built");
                //WinFormPanel.backColor(Color.White);

                /**add_Sections();
                 * if (Sections.size() > 0 && Sections[0].WinFormsControl.notNull())
                 *      WinFormPanel.add_Control(Sections[0].WinFormsControl);*/



                return this;
            }));
        }
Exemplo n.º 2
0
        public WPF_GUI_Section add_Section(WPF_GUI_Section section)
        {
            section.Wpf_Gui = this;
            return((WPF_GUI_Section)this.invokeOnThread(
                       () => {
                var outlookSection = new  OutlookSection();

                section.SectionInGui = outlookSection;
                outlookSection.Header = section.Name;
                var stackPanel = outlookSection.add_StackPanel();
                if (section.IntroText.valid())
                {
                    var textBlock = stackPanel.add_TextBlock();
                    textBlock.set_Text_Wpf(section.IntroText);
                }
                //section.ContentPanel = stackPanel.add_WrapPanel();
                section.ContentPanel = stackPanel.add_StackPanel();


                if (section.WinFormsCtor.notNull())
                {
                    section.WinFormsControl = section.WinFormsCtor();
                }

                outlookSection.Click +=
                    (sender, e) => {
                    if (section.WinFormsControl.notNull())
                    {
                        WinFormPanel.clear();
                        WinFormPanel.add_Control(section.WinFormsControl);
                    }
                };

                GUI_OutlookBar.Sections.Add(outlookSection);
                GuiSections.Add(section);
                return section;
            }));
        }