/// <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"));
            }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
        /// <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;
            }
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
        /// <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);
            }
        }
コード例 #6
0
 /// <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);
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 protected override void OnRemoved(TypedCollectionEventArgs <KryptonBreadCrumbItem> e)
 {
     base.OnRemoved(e);
     e.Item.Parent = null;
     this._owner.OnPropertyChanged(new PropertyChangedEventArgs("Items"));
 }
コード例 #9
0
 protected override void OnInserting(TypedCollectionEventArgs <KryptonBreadCrumbItem> e)
 {
     e.Item.Parent = this._owner;
     base.OnInserting(e);
 }