예제 #1
0
        public LayoutDropDown(ActionDispatcher dispatcher, WebDropDownAction action, WebIconSize iconSize)
		{
			InitializeComponent();
            
            _iconSize = iconSize;
            _actionDispatcher = dispatcher;
            _actionItem = action;
            _popup = new LayoutPopup(dispatcher, action.DropDownActions).AsSingleton();

			dispatcher.Register(_actionItem.Identifier, this);

            SetIcon();

            ToolTipService.SetToolTip(LayoutDropDownButton, _actionItem.ToolTip);

			ButtonComponent.Click += OnDropClick;

            LayoutDropDownButton.MouseEnter += ButtonComponent_MouseEnter;
            LayoutDropDownButton.MouseLeave += ButtonComponent_MouseLeave;

            Visibility = _actionItem.DesiredVisiblility;

			ButtonComponent.IsEnabled = _actionItem.Enabled;

            IndicateChecked(false); //This button doesn't have a checked state.
		}
예제 #2
0
        public StandardButton(ActionDispatcher dispatcher, WebClickAction icon, WebIconSize iconSize)
        {
            InitializeComponent();

            _actionItem       = icon;
            _actionDispatcher = dispatcher;

            _actionDispatcher.Register(_actionItem.Identifier, this);

            SetIconSize(iconSize);
            SetIcon();

            ToolTipService.SetToolTip(ButtonComponent, _actionItem.ToolTip);

            ButtonComponent.Click += OnClick;

            Visibility = _actionItem.DesiredVisiblility;

            ButtonComponent.IsEnabled   = _actionItem.Enabled;
            ButtonComponent.MouseEnter += ButtonComponentMouseEnter;
            ButtonComponent.MouseLeave += ButtonComponentMouseLeave;

            IndicateChecked(_actionItem.IsCheckAction && _actionItem.Checked);

            OverlayCheckedIndicator.Opacity = _actionItem.IconSet.HasOverlay ? 1 : 0;
        }
예제 #3
0
		public DropDownButton(ActionDispatcher dispatcher, WebDropDownButtonAction action, WebIconSize iconSize)
		{
			InitializeComponent();

            _iconSize = iconSize;
            _actionDispatcher = dispatcher;
			_actionItem = action;
			
			dispatcher.Register(_actionItem.Identifier, this);

            SetIcon();

            ToolTipService.SetToolTip(StackPanelVerticalComponent, _actionItem.ToolTip);

			ButtonComponent.Click += OnClick;
		    DropButtonComponent.Height = ButtonComponent.Height;
		    DropButtonComponent.Click += OnDropClick;
            
            _dropMenu = MenuBuilder.BuildContextMenu(action, _actionDispatcher);

            StackPanelVerticalComponent.MouseEnter += ButtonComponent_MouseEnter;
            StackPanelVerticalComponent.MouseLeave += ButtonComponent_MouseLeave;

            Visibility = _actionItem.DesiredVisiblility;

			ButtonComponent.IsEnabled = _actionItem.Enabled;
			DropButtonComponent.IsEnabled = _actionItem.Enabled;

            IndicateChecked(_actionItem.IsCheckAction && _actionItem.Checked);

            OverlayCheckedIndicator.Opacity = _actionItem.IconSet.HasOverlay ? 1 : 0;
		}
예제 #4
0
        public LayoutDropDown(ActionDispatcher dispatcher, WebDropDownAction action, WebIconSize iconSize)
        {
            InitializeComponent();

            _iconSize         = iconSize;
            _actionDispatcher = dispatcher;
            _actionItem       = action;
            _popup            = new LayoutPopup(dispatcher, action.DropDownActions).AsSingleton();

            dispatcher.Register(_actionItem.Identifier, this);

            SetIcon();

            ToolTipService.SetToolTip(LayoutDropDownButton, _actionItem.ToolTip);

            ButtonComponent.Click += OnDropClick;

            LayoutDropDownButton.MouseEnter += ButtonComponent_MouseEnter;
            LayoutDropDownButton.MouseLeave += ButtonComponent_MouseLeave;

            Visibility = _actionItem.DesiredVisiblility;

            ButtonComponent.IsEnabled = _actionItem.Enabled;

            IndicateChecked(false); //This button doesn't have a checked state.
        }
예제 #5
0
        public StandardButton(ActionDispatcher dispatcher, WebClickAction icon, WebIconSize iconSize)
		{
			InitializeComponent();

			_actionItem = icon;
            _actionDispatcher = dispatcher;

            _actionDispatcher.Register(_actionItem.Identifier, this);

            SetIconSize(iconSize); 
            SetIcon();

			ToolTipService.SetToolTip(ButtonComponent, _actionItem.ToolTip);

			ButtonComponent.Click += OnClick;

            Visibility = _actionItem.DesiredVisiblility;

			ButtonComponent.IsEnabled = _actionItem.Enabled;
            ButtonComponent.MouseEnter += ButtonComponentMouseEnter;
            ButtonComponent.MouseLeave += ButtonComponentMouseLeave;

			IndicateChecked(_actionItem.IsCheckAction && _actionItem.Checked);

            OverlayCheckedIndicator.Opacity = _actionItem.IconSet.HasOverlay ? 1 : 0;
		}
예제 #6
0
        public DropDownButton(ActionDispatcher dispatcher, WebDropDownButtonAction action, WebIconSize iconSize)
        {
            InitializeComponent();

            _iconSize         = iconSize;
            _actionDispatcher = dispatcher;
            _actionItem       = action;

            dispatcher.Register(_actionItem.Identifier, this);

            SetIcon();

            ToolTipService.SetToolTip(StackPanelVerticalComponent, _actionItem.ToolTip);

            ButtonComponent.Click     += OnClick;
            DropButtonComponent.Height = ButtonComponent.Height;
            DropButtonComponent.Click += OnDropClick;

            _dropMenu = MenuBuilder.BuildContextMenu(action, _actionDispatcher);

            StackPanelVerticalComponent.MouseEnter += ButtonComponent_MouseEnter;
            StackPanelVerticalComponent.MouseLeave += ButtonComponent_MouseLeave;

            Visibility = _actionItem.DesiredVisiblility;

            ButtonComponent.IsEnabled     = _actionItem.Enabled;
            DropButtonComponent.IsEnabled = _actionItem.Enabled;

            IndicateChecked(_actionItem.IsCheckAction && _actionItem.Checked);

            OverlayCheckedIndicator.Opacity = _actionItem.IconSet.HasOverlay ? 1 : 0;
        }
예제 #7
0
파일: MenuBuilder.cs 프로젝트: nhannd/Xian
 public MenuItemBinding(WebAction action, ActionDispatcher dispatcher, MenuItem item)
 {
     _actionItem = action;
     _actionDispatcher = dispatcher;
     _actionDispatcher.Register(action.Identifier, this);
     item.Click += OnItemClick;
     Item = item;
 }