protected override Control CreateContainerOverride(object item) { T result = item as T; if (result == null) { TreeDataTemplate template = this.GetTreeDataTemplate(item); result = new T { Header = template.Build(item), Items = template.ItemsSelector(item), IsExpanded = template.IsExpanded(item), }; } return(result); }
protected override Control CreateContainerOverride(object item) { T result = item as T; if (result == null) { TreeDataTemplate template = this.GetTreeDataTemplate(item); System.Diagnostics.Debug.WriteLine("{0} created item for {1}", this.GetHashCode(), item); result = new T { Header = template.Build(item), Items = template.ItemsSelector(item), IsExpanded = template.IsExpanded(item), }; } return(result); }