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(); }