Exemplo n.º 1
0
        private static MenuItem BuildActionMenuItem(WebActionNode subNode, ActionDispatcher dispatcher)
        {
            WebAction actionNode = subNode as WebAction;

            MenuItem item = new MenuItem
            {
                IsEnabled  = actionNode.Enabled,
                IsChecked  = (actionNode is WebClickAction) && (actionNode as WebClickAction).Checked,
                Visibility = actionNode.DesiredVisiblility
            };

            var binding = new MenuItemBinding(actionNode, dispatcher, item);

            binding.SetLabel(actionNode.Label);
            binding.SetIcon();

            item.Tag = binding;

            return(item);
        }
Exemplo n.º 2
0
        private static MenuItem BuildActionMenuItem(WebActionNode subNode, ActionDispatcher dispatcher)
        {
            WebAction actionNode = subNode as WebAction;

            MenuItem item = new MenuItem
            {
                IsEnabled = actionNode.Enabled,
                IsChecked = (actionNode is WebClickAction) && (actionNode as WebClickAction).Checked,
                Visibility = actionNode.DesiredVisiblility
            };

            var binding = new MenuItemBinding(actionNode, dispatcher, item);

            binding.SetLabel(actionNode.Label);
            binding.SetIcon();

            item.Tag = binding;

            return item;
        }