Exemplo n.º 1
0
        public async Task ShowMenu(string id, string x, string y, string targetId = null, DotNetObjectReference <ContextMenuTrigger> trigger = null)
        {
            var menu = _contextMenuStorage.GetMenu(id);

            if (menu != null)
            {
                await menu.Show(x, y, targetId, trigger?.Value);
            }
        }
Exemplo n.º 2
0
        public async Task HideMenu(string id)
        {
            var menu = _contextMenuStorage.GetMenu(id);

            if (menu == null)
            {
                throw new Exception($"No context menu with id '{id}' was found");
            }
            await _jSRuntime.InvokeVoidAsync("blazorContextMenu.Hide", id);
        }
Exemplo n.º 3
0
        public async Task ShowMenu(string id, int x, int y, object data)
        {
            var menu = _contextMenuStorage.GetMenu(id);

            if (menu == null)
            {
                throw new Exception($"No context menu with id '{id}' was found");
            }
            menu.Data = data;
            await _jSRuntime.InvokeVoidAsync("blazorContextMenu.ManualShow", id, x, y);
        }