예제 #1
0
파일: MenuBuilder.cs 프로젝트: nhannd/Xian
        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);
                }
            }
        }
예제 #2
0
        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);
                    }
                }
            }
        }
예제 #3
0
파일: MenuBuilder.cs 프로젝트: nhannd/Xian
 internal static IPopup BuildContextMenu(WebActionNode model, ActionDispatcher actionDispatcher)
 {
     ContextMenu menu = new ContextMenu();
     return new MenuAdapter(menu, model, actionDispatcher);
 }
예제 #4
0
        internal static IPopup BuildContextMenu(WebActionNode model, ActionDispatcher actionDispatcher)
        {
            ContextMenu menu = new ContextMenu();

            return(new MenuAdapter(menu, model, actionDispatcher));
        }
예제 #5
0
파일: MenuManager.cs 프로젝트: nhannd/Xian
 public static void SetAttachedContextMenu(DependencyObject obj, ContextMenu value)
 {
     obj.SetValue(AttachedContextMenuProperty, value);
 }