public MFullScreenDialog(EvasObject parent) : base(parent)
        {
            Style = Styles.Popup.FullScreen;

            _titleLayout = new Layout(this);
            _titleLayout.SetTheme("layout", Styles.Material, Styles.Popup.FullScreenTitle);
            _titleLayout.EdjeObject.AddSignalAction(Signal.ActionClick, "*", (s, e) =>
            {
                Dismiss();
            });

            _actionButton = new MButton(this)
            {
                Style = Styles.Popup.PopupButton2,
            };
            _titleLayout.SetPartContent(Parts.Popup.ActionButton, _actionButton);

            _actionButton.Clicked += (s, e) =>
            {
                Dismiss();
                ActionClicked?.Invoke(this, EventArgs.Empty);
            };

            SetPartContent(Parts.Layout.Title, _titleLayout);

            MColors.AddColorSchemeComponent(this);
        }
Example #2
0
        public MAlertDialog(EvasObject parent) : base(parent)
        {
            Style = Styles.Popup.Alert;

            _confirmButton = new Button(parent)
            {
                Style = Styles.Popup.PopupButton
            };

            _confirmButton.Clicked += (s, e) =>
            {
                Dismiss();
                Confirmed?.Invoke(this, EventArgs.Empty);
            };

            _cancelButton = new Button(this)
            {
                Style = Styles.Popup.PopupButton
            };

            _cancelButton.Clicked += (s, e) =>
            {
                Dismiss();
            };

            SetPartContent(Parts.Popup.Button2, _confirmButton);
            SetPartContent(Parts.Popup.Button1, _cancelButton);

            MColors.AddColorSchemeComponent(this);
        }
Example #3
0
 public MMenus(EvasObject parent) : base(parent)
 {
     Style        = Styles.Material;
     IsHorizontal = false;
     AutoHide     = true;
     MColors.AddColorSchemeComponent(this);
 }
        public MRadioButton(EvasObject parent) : base(parent)
        {
            MaterialComponents.VerifyComponentEnabled(this);

            Style = Styles.RadioButton.Style;
            MColors.AddColorSchemeComponent(this);
        }
        public MSnackBars(EvasObject parent) : base(parent)
        {
            MaterialComponents.VerifyComponentEnabled(this);

            Style       = Styles.Popup.SnackBars;
            Orientation = PopupOrientation.Bottom;
            MColors.AddColorSchemeComponent(this);
        }
Example #6
0
        public MTabs(EvasObject parent) : base(parent)
        {
            MaterialComponents.VerifyComponentEnabled(this);

            Style = Styles.Material;
            _toolbar.SelectionMode = ToolbarSelectionMode.Always;

            MColors.AddColorSchemeComponent(this);
        }
Example #7
0
 public MNavigationView(EvasObject parent) : base(parent)
 {
     Initialize(parent);
     LayoutUpdated += (s, e) =>
     {
         UpdateChildGeometry();
     };
     MColors.AddColorSchemeComponent(this);
 }
 public MNavigationView(EvasObject parent) : base(parent)
 {
     Initialize(parent);
     SetLayoutCallback(() =>
     {
         UpdateChildGeometry();
     });
     MColors.AddColorSchemeComponent(this);
 }
Example #9
0
        public MTextField(EvasObject parent) : base(parent)
        {
            Focused   += OnFocused;
            Unfocused += OnUnfocused;

            IsSingleLine = true;

            MColors.AddColorSchemeComponent(this);
        }
Example #10
0
        public MNavigationView(EvasObject parent) : base(parent)
        {
            MaterialComponents.VerifyComponentEnabled(this);

            Initialize(parent);
            _box.SetLayoutCallback(() =>
            {
                UpdateChildGeometry();
            });
            MColors.AddColorSchemeComponent(this);
        }
        public MTextField(EvasObject parent) : base(parent)
        {
            _changed     = new SmartEvent(this, this.RealHandle, Events.Changed);
            _changed.On += OnChanged;

            Focused   += OnFocused;
            Unfocused += OnUnfocused;

            IsSingleLine = true;

            MColors.AddColorSchemeComponent(this);
        }
        public MFloatingActionButton(MConformant conformant)
        {
            _button = new Button(conformant.FloatingLayout)
            {
                Style = Styles.Button.FloatingButton,
            };
            _button.Clicked += (s, e) => { Clicked?.Invoke(this, EventArgs.Empty); };

            _box = conformant.FloatingLayout as Box;
            _box.PackEnd(_button);
            _box.RepeatEvents = true;
            _box.SetLayoutCallback(() => { });

            MColors.AddColorSchemeComponent(this);
        }
        public MAppBar(EvasObject parent) : base(parent)
        {
            MaterialComponents.VerifyComponentEnabled(this);

            AlignmentX    = -1;
            WeightX       = 1;
            MinimumHeight = DefaultValues.AppBar.Height;

            _box = new Box(this)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1
            };
            SetContent(_box);

            _naviButton = new MButton(_box);

            _items.CollectionChanged += OnItemsCollectionChanged;
            _box.SetLayoutCallback(() => { UpdateChildrenGeometry(); });

            MColors.AddColorSchemeComponent(this);
        }
Example #14
0
 public MSlider(EvasObject parent) : base(parent)
 {
     Style = Styles.Material;
     MColors.AddColorSchemeComponent(this);
 }
        public MConfirmationDialog(EvasObject parent) : base(parent)
        {
            Style = Styles.Popup.Confirmation;

            _layout = new Box(parent)
            {
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX    = 1,
                WeightY    = 1,
            };
            _layout.Show();

            _genList = new GenList(parent)
            {
                WeightX       = 1,
                WeightY       = 1,
                AlignmentY    = -1,
                AlignmentX    = -1,
                SelectionMode = GenItemSelectionMode.Always
            };

            _itemClass = new GenItemClass(Styles.GenListItem.Default)
            {
                GetContentHandler = GetContent,
                GetTextHandler    = GetText
            };

            _genList.ItemSelected += (s, e) =>
            {
                var item = e.Item.Data as MConfirmationDialogItem;
                if (item.CheckBox is Radio r)
                {
                    r.GroupValue = item.Id;
                }
                else if (item.CheckBox is Check c)
                {
                    c.IsChecked = !c.IsChecked;
                }

                _confirmButton.IsEnabled = (_itemList.Where(kv => kv.Value.IsSelected).Count() > 0);
            };

            OutsideClicked += (s, e) =>
            {
                Dismiss();
            };

            _genList.Show();
            _layout.PackEnd(_genList);

            _confirmButton = new Button(this)
            {
                Style     = Styles.Popup.PopupButton,
                IsEnabled = false
            };

            _confirmButton.Clicked += (s, e) =>
            {
                Dismiss();
                var selected = _itemList.Where(kv => kv.Value.IsSelected).Select(kv => kv.Value);
                ItemSelected?.Invoke(this, new MConfirmationDialogItemSelectedArgs(selected));
            };

            _cancelButton = new Button(this)
            {
                Style = Styles.Popup.PopupButton
            };

            _cancelButton.Clicked += (s, e) =>
            {
                Dismiss();
            };

            SetPartContent(Parts.Popup.Button2, _confirmButton);
            SetPartContent(Parts.Popup.Button1, _cancelButton);

            SetContent(_layout);

            MColors.AddColorSchemeComponent(this);
        }
Example #16
0
 public MCheckBox(EvasObject parent) : base(parent)
 {
     Style = Styles.CheckBox.Style;
     MColors.AddColorSchemeComponent(this);
 }
Example #17
0
 public MSnackBars(EvasObject parent) : base(parent)
 {
     Style       = Styles.Popup.SnackBars;
     Orientation = PopupOrientation.Bottom;
     MColors.AddColorSchemeComponent(this);
 }
Example #18
0
 public MSwitch(EvasObject parent) : base(parent)
 {
     Style = Styles.Switch.Style;
     MColors.AddColorSchemeComponent(this);
 }
 public MList(EvasObject parent) : base(parent)
 {
     MColors.AddColorSchemeComponent(this);
     ItemRealized += OnItemRealized;
     Deleted      += OnDeleted;
 }
 public MRadioButton(EvasObject parent) : base(parent)
 {
     Style = Styles.RadioButton.Style;
     MColors.AddColorSchemeComponent(this);
 }
 protected MProgressIndicator(EvasObject parent, string style) : base(parent)
 {
     Style = style;
     MColors.AddColorSchemeComponent(this);
 }
 internal MPopupButton(EvasObject parent)
     : base(parent)
 {
     Style = Styles.Popup.PopupButton;
     MColors.AddColorSchemeComponent(this);
 }
Example #23
0
 public MCheckBox(EvasObject parent) : base(parent)
 {
     MaterialComponents.VerifyComponentEnabled(this);
     Style = Styles.CheckBox.Style;
     MColors.AddColorSchemeComponent(this);
 }