protected virtual void Dispose(bool disposing) { if (!_disposed) { if (_actionDispatcher != null) { _actionDispatcher.Remove(_actionItem.Identifier); _actionDispatcher = null; } StackPanelVerticalComponent.MouseEnter -= ButtonComponent_MouseEnter; StackPanelVerticalComponent.MouseLeave -= ButtonComponent_MouseLeave; ButtonComponent.Click -= OnClick; DropButtonComponent.Click -= OnDropClick; if (_dropMenu != null) { if (disposing) { _dropMenu.Dispose(); } _dropMenu = null; } _disposed = true; } }
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; }
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; }
public LayoutPopup(ActionDispatcher dispatcher, IEnumerable <WebActionNode> actions) { InitializeComponent(); Popup.IsOpen = false; IsTabStop = true; // allow focus _actionDispatcher = dispatcher; //because the layout popup is just like a context menu, handle the right mouse explicitly. HostRoot.MouseRightButtonDown += delegate(object sender, MouseButtonEventArgs e) { e.Handled = true; Hide(); }; HostRoot.MouseRightButtonUp += (sender, e) => e.Handled = true; foreach (WebLayoutChangerAction node in actions) { if (node.ActionID.Equals("chooseBoxLayout")) { _imageBoxAction = node; } else if (node.ActionID.Equals("chooseTileLayout")) { _tilesAction = node; } } ImageBoxLayoutText.Text = _imageBoxAction.Label = Labels.MenuImageBoxLayout; TileLayoutText.Text = _tilesAction.Label = Labels.MenuTileLayout; CreateGridElements(); }
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. }
protected virtual void Dispose(bool disposing) { if (!_disposed) { _actionDispatcher = null; foreach (Box theBox in _imageBoxList) { theBox.OnClick -= OnClick; } _imageBoxList.Clear(); _disposed = true; } }
public void Dispose() { if (!_disposed) { if (_actionDispatcher != null) { _actionDispatcher.Remove(_actionItem.Identifier); _actionDispatcher = null; } ButtonComponent.MouseEnter -= ButtonComponentMouseEnter; ButtonComponent.MouseLeave -= ButtonComponentMouseLeave; ButtonComponent.Click -= OnClick; _disposed = true; } }
protected virtual void Dispose(bool disposing) { if (!_disposed) { if (_actionDispatcher != null) { _actionDispatcher.Remove(_actionItem.Identifier); _actionDispatcher = null; } LayoutDropDownButton.MouseEnter -= ButtonComponent_MouseEnter; LayoutDropDownButton.MouseLeave -= ButtonComponent_MouseLeave; ButtonComponent.Click -= OnDropClick; _popup.Dispose(); _popup = null; _disposed = true; } }