public OperationTextBox(Operation operation, IControlsOperations classController) { this.operation = operation; this.classController = classController; #region Operation context menu this.ContextMenu = new ContextMenu(); ContextMenuItem remove = new ContextMenuItem("Remove operation"); remove.Icon = ContextMenuIcon.GetContextIcon("delete2"); remove.Click += delegate { classController.RemoveOperation(operation); }; this.ContextMenu.Items.Add(remove); #endregion operation.PropertyChanged += delegate { RefreshTextContent(); }; RefreshTextContent(); }
/// <summary> /// Removes visualization of <paramref name="operation"/>/ /// </summary> /// <param name="operation">removed operation</param> public void RemoveOperation(Operation operation) { classController.RemoveOperation(operation); }