예제 #1
0
        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);
        }
예제 #2
0
        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);
        }