Exemple #1
0
        static void LayoutContent2(Label[] status, Panel mainPanel, Panel[] panels)
        {
            var splitLayout  = new SplitLayout(panels);
            var isFullScreen = false;

            mainPanel.Content = splitLayout.Layout(
                i =>
            {
                var button = new Button {
                    Text = "Click to make full screen" + i, BackgroundColor = splitLayout.PanelColors[i]
                };
                button.Click += (s, e) =>
                {
                    if (isFullScreen)
                    {
                        LayoutContent2(status, mainPanel, splitLayout.Panels);                                 // recursive
                    }
                    else
                    {
                        mainPanel.Content = splitLayout.Panels[i];
                    }
                    isFullScreen = !isFullScreen;
                };
                return(button);
            });
        }
Exemple #2
0
        private static void LayoutContent(Label[] status, Panel mainPanel)
        {
            var count       = 0;
            var splitLayout = new SplitLayout();

            mainPanel.Content = splitLayout.Layout(
                i => {
                var button = new Button {
                    Text = "Click to update status " + i, BackgroundColor = splitLayout.PanelColors[i]
                };
                button.Click += (s, e) => status[i].Text = "New count: " + (count++);
                return(button);
            });
        }
		private static void LayoutContent(Label[] status, Panel mainPanel)
		{
			var count = 0;
			var splitLayout = new SplitLayout();
			mainPanel.Content = splitLayout.Layout(
				i => {
					var button = new Button { Text = "Click to update status " + i, BackgroundColor = splitLayout.PanelColors[i] };
					button.Click += (s, e) => status[i].Text = "New count: " + (count++);
					return button;
				});
		}
		private static void LayoutContent2(Label[] status, Panel mainPanel, Panel[] panels)
		{
			var splitLayout = new SplitLayout(panels);
			var isFullScreen = false;
			mainPanel.Content = splitLayout.Layout(
				i => {
					var button = new Button { Text = "Click to make full screen" + i, BackgroundColor = splitLayout.PanelColors[i] };
					button.Click += (s, e) => {
						if (isFullScreen)
							LayoutContent2(status, mainPanel, splitLayout.Panels); // recursive
						else
							mainPanel.Content = splitLayout.Panels[i];
						isFullScreen = !isFullScreen;
					};
					return button;
				});
		}