public override void Run(Window window) { Rect rect = new Rect(0, 0, window.ScreenSize.Width, window.ScreenSize.Height); X1 = rect.X; Y1 = rect.Y; X2 = rect.X + rect.Width - rect.Width / 10; Y2 = rect.Y; square = new Rectangle(window) { Geometry = new Rect(X1, Y1, rect.Width / 10, rect.Height / 6), Color = Color.Red }; square.Show(); Button btn = new Button(window) { Geometry = new Rect(rect.X, rect.Y + rect.Height - rect.Height / 4, rect.Width, rect.Height / 4), Text = mappers[map_index].Item1 }; btn.Show(); timelineAnimator = new EcoreTimelineAnimator(1.0, OnTimeline); btn.Clicked += Btn_Clicked; timelineAnimator.Finished += (s, e) => { map_index = (map_index + 1) % mappers.Length; btn.IsEnabled = true; }; }
public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); box.PackEnd(GetTitleLabel(parent)); MActivityIndicator determinateAI = new MActivityIndicator(parent) { Value = 50, AlignmentX = -1, AlignmentY = 0.5, WeightX = 1, WeightY = 1, }; determinateAI.Show(); MActivityIndicator indeterminateAI = new MActivityIndicator(parent) { Type = MProgressIndicatorType.Indeterminate, AlignmentX = -1, AlignmentY = 0.5, WeightX = 1, WeightY = 1, }; indeterminateAI.Show(); box.PackEnd(determinateAI); box.PackEnd(indeterminateAI); double max = 1.0; double min = 0; double unit = 0.1; if (_animator == null) { _animator = new EcoreTimelineAnimator(1.0, () => { var val = determinateAI.Value + unit; if (val <= max) { determinateAI.Value = val; } }); _animator.Finished += (s, e) => { determinateAI.Value = min; _animator.Start(); }; } _animator.Start(); return(box); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new Box(window) { BackgroundColor = Color.White }; conformant.SetContent(box); box.Show(); MActivityIndicator determinateAI = new MActivityIndicator(window) { Value = 50, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; determinateAI.Show(); MActivityIndicator indeterminateAI = new MActivityIndicator(window) { Text = "Linear progress indicator (Indeterminate)", Type = MProgressIndicatorType.Indeterminate, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; indeterminateAI.Show(); Label label1 = new Label(window) { Text = "Circular progress indicator (Determinate)", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; label1.Show(); Label label2 = new Label(window) { Text = "Circular progress indicator (Indeterminate)", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; label2.Show(); box.PackEnd(label1); box.PackEnd(determinateAI); box.PackEnd(label2); box.PackEnd(indeterminateAI); double max = 1.0; double min = 0; double unit = 0.1; if (_animator == null) { _animator = new EcoreTimelineAnimator(1.0, () => { var val = determinateAI.Value + unit; if (val <= max) { determinateAI.Value = val; } }); _animator.Finished += (s, e) => { determinateAI.Value = min; _animator.Start(); }; } _animator.Start(); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.5, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion MProgressIndicator determinatePI = new MProgressIndicator(window) { Value = 0, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; determinatePI.Show(); MProgressIndicator indeterminatePI = new MProgressIndicator(window) { Text = "Linear progress indicator (Indeterminate)", Type = MProgressIndicatorType.Indeterminate, AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; indeterminatePI.Show(); MProgressIndicator disabledPI = new MProgressIndicator(window) { Text = "Disabled", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, IsEnabled = false, }; disabledPI.Show(); Label label1 = new Label(window) { Text = "Linear progress indicator (Determinate)", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; label1.Show(); Label label2 = new Label(window) { Text = "Linear progress indicator (Indeterminate)", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; label2.Show(); box.PackEnd(label1); box.PackEnd(determinatePI); box.PackEnd(label2); box.PackEnd(indeterminatePI); box.PackEnd(disabledPI); double max = 1.0; double min = 0; double unit = 0.1; if (_animator == null) { _animator = new EcoreTimelineAnimator(1.0, () => { var val = determinatePI.Value + unit; if (val <= max) { determinatePI.Value = val; } }); _animator.Finished += (s, e) => { determinatePI.Value = min; _animator.Start(); }; } _animator.Start(); }
public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); MProgressIndicator determinatePI = new MProgressIndicator(parent) { Value = 0, MinimumWidth = 200, AlignmentY = 0.5, WeightX = 1, WeightY = 1 }; determinatePI.Show(); MProgressIndicator indeterminatePI = new MProgressIndicator(parent) { Type = MProgressIndicatorType.Indeterminate, MinimumWidth = 200, AlignmentY = 0.5, WeightX = 1, WeightY = 1, }; indeterminatePI.Show(); MProgressIndicator disabledPI = new MProgressIndicator(parent) { MinimumWidth = 200, AlignmentY = 0.5, WeightX = 1, WeightY = 1, IsEnabled = false, }; disabledPI.Show(); box.PackEnd(determinatePI); box.PackEnd(indeterminatePI); box.PackEnd(disabledPI); double max = 1.0; double min = 0; double unit = 0.1; if (_animator == null) { _animator = new EcoreTimelineAnimator(1.0, () => { var val = determinatePI.Value + unit; if (val <= max) { determinatePI.Value = val; } }); } _animator.Start(); return(box); }