protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { TreeListBoxItem item2 = element as TreeListBoxItem; TreeListBoxInfo info = item as TreeListBoxInfo; this.OnNewItemCreated(new TreeListBoxItemCreatedEventArgs(item2, info)); item2.PrepareItem(info); base.PrepareContainerForItemOverride(element, info.DataItem); }
static TreeListBoxItem() { IsExpandedProperty = DependencyProperty.Register("IsExpanded", typeof(bool), typeof(TreeListBoxItem), new UIPropertyMetadata(false, delegate(DependencyObject sender, DependencyPropertyChangedEventArgs e) { TreeListBoxItem item = (TreeListBoxItem)sender; if (!item.isInitializing) { item.ExpandCollapseItem(); } })); HasItemsProperty = DependencyProperty.Register("HasItems", typeof(bool), typeof(TreeListBoxItem), new UIPropertyMetadata(false, delegate(DependencyObject sender, DependencyPropertyChangedEventArgs e) { TreeListBoxItem item = (TreeListBoxItem)sender; if (!item.isInitializing) { item.ExpandCollapseItem(); } })); FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(typeof(TreeListBoxItem), new FrameworkPropertyMetadata(typeof(TreeListBoxItem))); }
public TreeListBoxItemCreatedEventArgs(TreeListBoxItem item, TreeListBoxInfo info) { this.newItem = item; this.newItemInfo = info; }