Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have a couple of options.</p> <p><strong>Option 1:</strong></p> <p>If you are just wanting to expose the <code>FloorsGrouping.Items</code> property at design time, you can change the <code>Tab</code> property's type to <code>SubItemsCollection</code> and return the <code>Items</code> property. In this case, you won't have to worry about intercepting any collection change events, it will happen for you automatically.</p> <pre><code>[Category("Data")] [DisplayName("Tabs")] [Description("Tabsssssssssssss")] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Editor(typeof(ItemsCollectionEditor), typeof(UITypeEditor))] public SubItemsCollection Tab { get { return Items; } } </code></pre> <p><strong>Option 2:</strong></p> <p>If you are needing to intercept the collection change events, modify the <code>Tabs</code> class to inherit from <code>ObservableCollection&lt;FloorsInformation&gt;</code>, which implements <code>INotifyCollectionChanged</code>.</p> <pre><code>public class Tabs : System.Collections.ObjectModel.ObservableCollection&lt;FloorsInformation&gt; { } </code></pre> <p>And in your <code>FloorsGrouping</code> constructor, subscribe to the <code>CollectionChanged</code> event.</p> <pre><code>public FloorsGrouping() { ... tabs.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(tabs_CollectionChanged); } </code></pre> <p>Finally, in your event handler, process the collection change.</p> <pre><code>private void tabs_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { switch (e.Action) { case System.Collections.Specialized.NotifyCollectionChangedAction.Add: foreach (DockContainerItem dciItem in e.NewItems) { if (!Parent.Controls.ContainsKey(dciItem.Name)) Items.Add(dciItem); } break; case System.Collections.Specialized.NotifyCollectionChangedAction.Reset: Items.Clear(); break; } } </code></pre> <p>What you'll notice with option 2 is that the <code>CollectionChanged</code> event fires in real time with the editing in the collection editor, not specifically when the OK button is clicked. However, when the user finally clicks the OK or Cancel button in the collection editor, the collection's state is accurate.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload