diff --git a/Perspex/Controls/TreeDataTemplate.cs b/Perspex/Controls/TreeDataTemplate.cs index c38754eb32..5b9ca4fab6 100644 --- a/Perspex/Controls/TreeDataTemplate.cs +++ b/Perspex/Controls/TreeDataTemplate.cs @@ -41,7 +41,7 @@ namespace Perspex.Controls public class TreeDataTemplate : TreeDataTemplate { public TreeDataTemplate( - Func build, + Func build, Func itemsSelector) : base(typeof(T), o => build((T)o), o => itemsSelector((T)o)) { diff --git a/TestApplication/Program.cs b/TestApplication/Program.cs index c259ff101a..b949112646 100644 --- a/TestApplication/Program.cs +++ b/TestApplication/Program.cs @@ -87,7 +87,7 @@ namespace TestApplication DataTemplates = new DataTemplates { new TreeDataTemplate( - x => new TextBlock { Text = x.ToString() }, + x => new TextBlock { Text = x.Name }, x => x.Children), }, }; @@ -98,77 +98,77 @@ namespace TestApplication { Items = new[] { - //new TabItem - //{ - // Header = "Buttons", - // Content = new StackPanel - // { - // Orientation = Orientation.Vertical, - // HorizontalAlignment = HorizontalAlignment.Center, - // VerticalAlignment = VerticalAlignment.Center, - // Gap = 8, - // MinWidth = 120, - // Children = new Controls - // { - // new Button - // { - // Content = "Button", - // }, - // new Button - // { - // Content = "Button", - // Background = new SolidColorBrush(0xcc119eda), - // }, - // new CheckBox - // { - // Content = "Checkbox", - // }, - // } - // }, - //}, - //new TabItem - //{ - // Header = "Text", - // Content = new StackPanel - // { - // Orientation = Orientation.Vertical, - // HorizontalAlignment = HorizontalAlignment.Center, - // VerticalAlignment = VerticalAlignment.Center, - // Gap = 8, - // Width = 120, - // Children = new Controls - // { - // new TextBlock - // { - // Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt.", - // }, - // new TextBox - // { - // Text = "Text Box", - // }, - // } - // }, - //}, - //new TabItem - //{ - // Header = "Images", - // Content = new StackPanel - // { - // Orientation = Orientation.Vertical, - // HorizontalAlignment = HorizontalAlignment.Center, - // VerticalAlignment = VerticalAlignment.Center, - // Gap = 8, - // Width = 120, - // Children = new Controls - // { - // new Image - // { - // Source = new Bitmap("github_icon.png"), - // Width = 200, - // }, - // } - // }, - //}, + new TabItem + { + Header = "Buttons", + Content = new StackPanel + { + Orientation = Orientation.Vertical, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + Gap = 8, + MinWidth = 120, + Children = new Controls + { + new Button + { + Content = "Button", + }, + new Button + { + Content = "Button", + Background = new SolidColorBrush(0xcc119eda), + }, + new CheckBox + { + Content = "Checkbox", + }, + } + }, + }, + new TabItem + { + Header = "Text", + Content = new StackPanel + { + Orientation = Orientation.Vertical, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + Gap = 8, + Width = 120, + Children = new Controls + { + new TextBlock + { + Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin venenatis dui quis libero suscipit tincidunt.", + }, + new TextBox + { + Text = "Text Box", + }, + } + }, + }, + new TabItem + { + Header = "Images", + Content = new StackPanel + { + Orientation = Orientation.Vertical, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + Gap = 8, + Width = 120, + Children = new Controls + { + new Image + { + Source = new Bitmap("github_icon.png"), + Width = 200, + }, + } + }, + }, new TabItem { Header = "Lists",