Beispiel #1
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;
        }
Beispiel #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;
		}
Beispiel #3
0
        protected override void UpdateEntity(Entity entity)
        {
            base.UpdateEntity(entity);
            WebClickAction webClickAction = (WebClickAction)entity;

            webClickAction.IsCheckAction = Action.IsCheckAction;
            webClickAction.Checked       = Action.Checked;
        }
Beispiel #4
0
 public void Update(PropertyChangedEvent e)
 {
     if (e.PropertyName.Equals("Available"))
     {
         _actionItem.Available = (bool)e.Value;
         Item.Visibility       = _actionItem.DesiredVisiblility;
     }
     else if (e.PropertyName.Equals("Visible"))
     {
         _actionItem.Visible = (bool)e.Value;
         Item.Visibility     = _actionItem.DesiredVisiblility;
     }
     else if (e.PropertyName.Equals("Enabled"))
     {
         _actionItem.Enabled = (bool)e.Value;
         Item.IsEnabled      = _actionItem.Enabled;
     }
     else if (e.PropertyName.Equals("IconSet"))
     {
         _actionItem.IconSet = e.Value as WebIconSet;
         SetIcon();
     }
     else if (e.PropertyName.Equals("Tooltip"))
     {
         _actionItem.ToolTip = e.Value as string;
     }
     else if (e.PropertyName.Equals("Label"))
     {
         _actionItem.Label = e.Value as string;
         SetLabel(_actionItem.Label);
     }
     else if (e.PropertyName.Equals("Checked"))
     {
         WebClickAction action = _actionItem as WebClickAction;
         action.Checked = (bool)e.Value;
         Item.IsChecked = action.Checked;
     }
 }