EvasObject CreateNewWindow(EvasObject parent, BaseGalleryPage page) { var box = new ColoredBox(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var titleLabel = new Label(parent) { AlignmentX = -1, AlignmentY = 1, WeightX = 1, WeightY = 1, LineWrapType = WrapType.Word, LineWrapWidth = 300, Text = $"<span align=center color=#000000>{page.Name}</span > " }; titleLabel.Show(); var button = new MButton(parent) { AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, Text = "run" }; button.Show(); button.Clicked += (s, e) => { Window window = new Window(page.Name); window.Show(); window.BackButtonPressed += (sender, args) => { page.TearDown(); window.Hide(); window.Unrealize(); }; page.Run(window); }; box.PackEnd(titleLabel); box.PackEnd(button); return(box); }
Window CreatePageWindow(BaseGalleryPage page) { Window window = new Window("MaterialGalleryPageWindow"); window.Show(); window.BackButtonPressed += (s, e) => { page.TearDown(); window.Hide(); window.Unrealize(); GC.Collect(); GC.WaitForPendingFinalizers(); }; return(window); }
EvasObject CreateNewWindow(EvasObject parent, BaseGalleryPage page) { var box = new ColoredBox(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; box.Show(); var button = new MButton(parent) { AlignmentX = -1, AlignmentY = 0.5, WeightX = 1, WeightY = 1, Text = "click" }; button.Show(); button.Clicked += (s, e) => { Window window = new Window(page.Name); window.Show(); window.BackButtonPressed += (sender, args) => { page.TearDown(); window.Hide(); window.Unrealize(); }; page.Run(window); }; box.PackEnd(button); return(box); }