public MenuAdapter(ContextMenu menu, WebActionNode model, ActionDispatcher actionDispatcher) : base(menu) { _menu = menu; if (model is WebDropDownButtonAction) { //TODO (CR May 2010): there's probably a more generic way to do this WebDropDownButtonAction a = model as WebDropDownButtonAction; foreach (WebActionNode node in a.DropDownActions) { MenuItem menuItem = BuildMenuItem(node, actionDispatcher); if (menuItem != null) _menu.Items.Add(menuItem); } } else { foreach (WebActionNode node in model.Children) { MenuItem menuItem = BuildMenuItem(node, actionDispatcher); if (menuItem != null) _menu.Items.Add(menuItem); } } }
public MenuAdapter(ContextMenu menu, WebActionNode model, ActionDispatcher actionDispatcher) : base(menu) { _menu = menu; if (model is WebDropDownButtonAction) { //TODO (CR May 2010): there's probably a more generic way to do this WebDropDownButtonAction a = model as WebDropDownButtonAction; foreach (WebActionNode node in a.DropDownActions) { MenuItem menuItem = BuildMenuItem(node, actionDispatcher); if (menuItem != null) { _menu.Items.Add(menuItem); } } } else { foreach (WebActionNode node in model.Children) { MenuItem menuItem = BuildMenuItem(node, actionDispatcher); if (menuItem != null) { _menu.Items.Add(menuItem); } } } }
internal static IPopup BuildContextMenu(WebActionNode model, ActionDispatcher actionDispatcher) { ContextMenu menu = new ContextMenu(); return new MenuAdapter(menu, model, actionDispatcher); }
internal static IPopup BuildContextMenu(WebActionNode model, ActionDispatcher actionDispatcher) { ContextMenu menu = new ContextMenu(); return(new MenuAdapter(menu, model, actionDispatcher)); }
public static void SetAttachedContextMenu(DependencyObject obj, ContextMenu value) { obj.SetValue(AttachedContextMenuProperty, value); }