/// <summary> /// Makes a floating button visible on alarm or worldclock page /// </summary> /// <param name="title">string</param> public void ShowFloatingButton(string title) { floatingButton.Show(); if (title == "Alarm") { #if ALARM_XAML floatingButton.FirstButton.Clicked += mainTabbed.AlarmXaml_OnFloatingButtonClicked; #else floatingButton.FirstButton.Clicked += mainTabbed.Alarm_FloatingButton_Clicked; #endif } else if (title == "World clock") { floatingButton.FirstButton.Clicked += mainTabbed.WorldClock_FloatingButton_Clicked; } else { return; } }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { AlignmentY = -1, AlignmentX = -1, WeightX = 1, WeightY = 1, }; box.Show(); conformant.SetContent(box); FloatingButton floatingButton = new FloatingButton(window) { Mode = FloatingButtonMode.All, AlignmentY = -1, AlignmentX = -1, WeightX = 1, WeightY = 1, }; floatingButton.Show(); floatingButton.Resize(700, 700); floatingButton.Move(0, 400); Box backGround = new Box(window) { AlignmentY = -1, AlignmentX = -1, WeightX = 1, WeightY = 1, }; backGround.Show(); Button button1 = CreateButton(window, "Mode change to LeftRightOnly"); button1.Clicked += (s, e) => { if (floatingButton.Mode == FloatingButtonMode.All) { floatingButton.Mode = FloatingButtonMode.LeftRightOnly; button1.Text = "Mode change to All"; } else { floatingButton.Mode = FloatingButtonMode.All; button1.Text = "Mode change to LeftRightOnly"; } }; button1.Show(); Button button2 = CreateButton(window, "MovementBlock Set"); button2.Clicked += (s, e) => { floatingButton.MovementBlock = !floatingButton.MovementBlock; if (floatingButton.MovementBlock) { button2.Text = "MovementBlock Unset"; } else { button2.Text = "MovementBlock Set"; } }; button2.Show(); Button button3 = CreateButton(window, "RedButton Set"); button3.Clicked += (s, e) => { if (_RedButton == null) { _RedButton = CreateButton(window, "RedButton"); _RedButton.BackgroundColor = Color.Red; floatingButton.SetPartContent("button1", _RedButton, true); button3.Text = "RedButton Unset"; } else { _RedButton.Unrealize(); _RedButton = null; floatingButton.SetPartContent("button1", _RedButton, true); button3.Text = "RedButton Set"; } }; button3.Show(); Button button4 = CreateButton(window, "GreenButton Set"); button4.Clicked += (s, e) => { if (_GreenButton == null) { _GreenButton = CreateButton(window, "GreenButton"); _GreenButton.BackgroundColor = Color.Green; floatingButton.SetPartContent("button2", _GreenButton, true); button4.Text = "GreenButton Unset"; } else { _GreenButton.Unrealize(); _GreenButton = null; floatingButton.SetPartContent("button2", _GreenButton, true); button4.Text = "GreenButton Unset"; } }; button4.Show(); box.PackEnd(backGround); box.PackEnd(button1); box.PackEnd(button2); box.PackEnd(button3); box.PackEnd(button4); }