Exemple #1
0
        public IconMenuItem AddSeparator()
        {
            IconMenuItem item = new IconMenuItem()
            {
                Kind = IconMenuItemKind.Separator
            };

            MenuItems.Add(item);
            return(item);
        }
Exemple #2
0
        public IconMenuItem AddMenuItem(string title, string comment, string icon, Action <object> command, object userData)
        {
            IconMenuItem item = new IconMenuItem()
            {
                Kind     = IconMenuItemKind.Command,
                Text     = title,
                Comment  = comment,
                Icon     = icon,
                Command  = command,
                UserData = userData
            };

            MenuItems.Add(item);

            return(item);
        }
Exemple #3
0
        private void MenuView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            if (BlockTap)
            {
                return;
            }
            BlockTap = true;
            menuView.SelectedItem = null;

            IconMenuItem item = (IconMenuItem)e.Item;

            if ((item == null) || (item.Kind == IconMenuItemKind.Separator))
            {
                return;
            }
            item?.Command(item.UserData);
            OnMenuTap?.Invoke(sender, e);
        }
Exemple #4
0
 public void AddMenuItem(IconMenuItem item)
 {
     MenuItems.Add(item);
 }