/// <summary> /// Raises the Removed event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected override void OnRemoved(TypedCollectionEventArgs <KryptonBreadCrumbItem> e) { base.OnRemoved(e); // Clear down parent relationship e.Item.Parent = null; // Notify a change in the owners items property _owner.OnPropertyChanged(new PropertyChangedEventArgs("Items")); }
/// <summary> /// Raises the Removing event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected override void OnRemoving(TypedCollectionEventArgs <KryptonContextMenuItemBase> e) { // Must unhook from the change event to prevent memory leak if (e.Item is KryptonContextMenuRadioButton radioButton) { radioButton.CheckedChanged -= OnRadioButtonCheckedChanged; } base.OnRemoving(e); }
/// <summary> /// Raises the Inserted event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected override void OnInserted(TypedCollectionEventArgs <KryptonContextMenuItemBase> e) { base.OnInserted(e); // We monitor changes to the checked state of radio buttons if (e.Item is KryptonContextMenuRadioButton radioButton) { radioButton.CheckedChanged += OnRadioButtonCheckedChanged; } }
/// <summary> /// Raises the Removing event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected override void OnRemoving(TypedCollectionEventArgs <KryptonContextMenuItemBase> e) { // Must unhook from the change event to prevent memory leak KryptonContextMenuRadioButton radioButton = e.Item as KryptonContextMenuRadioButton; if (radioButton != null) { radioButton.CheckedChanged -= new EventHandler(OnRadioButtonCheckedChanged); } base.OnRemoving(e); }
/// <summary> /// Raises the Inserted event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected override void OnInserted(TypedCollectionEventArgs <KryptonContextMenuItemBase> e) { base.OnInserted(e); // We monitor changes to the checked state of radio buttons KryptonContextMenuRadioButton radioButton = e.Item as KryptonContextMenuRadioButton; if (radioButton != null) { radioButton.CheckedChanged += new EventHandler(OnRadioButtonCheckedChanged); } }
/// <summary> /// Raises the Removed event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected virtual void OnRemoved(TypedCollectionEventArgs <T> e) { Removed?.Invoke(this, e); }
/// <summary> /// Raises the Inserted event. /// </summary> /// <param name="e">A TypedCollectionEventArgs instance containing event data.</param> protected virtual void OnInserted(TypedCollectionEventArgs <T> e) { Inserted?.Invoke(this, e); }
protected override void OnRemoved(TypedCollectionEventArgs <KryptonBreadCrumbItem> e) { base.OnRemoved(e); e.Item.Parent = null; this._owner.OnPropertyChanged(new PropertyChangedEventArgs("Items")); }
protected override void OnInserting(TypedCollectionEventArgs <KryptonBreadCrumbItem> e) { e.Item.Parent = this._owner; base.OnInserting(e); }