Browse Source

Renamed TreeDataTemplate -> FuncTreeDataTemplate.

pull/237/head
Steven Kirk 11 years ago
parent
commit
a0509caede
  1. 2
      samples/TestApplication/Program.cs
  2. 2
      samples/XamlTestApplication/Program.cs
  3. 2
      src/Perspex.Controls/Generators/TreeItemContainerGenerator.cs
  4. 4
      src/Perspex.Controls/Perspex.Controls.csproj
  5. 18
      src/Perspex.Controls/Templates/FuncTreeDataTemplate.cs
  6. 18
      src/Perspex.Controls/Templates/FuncTreeDataTemplate`1.cs
  7. 2
      src/Perspex.Diagnostics/Views/LogicalTreeView.cs
  8. 2
      src/Perspex.Diagnostics/Views/VisualTreeView.cs

2
samples/TestApplication/Program.cs

@ -86,7 +86,7 @@ namespace TestApplication
{
DataTemplates = new DataTemplates
{
new TreeDataTemplate<Node>(
new FuncTreeDataTemplate<Node>(
x => new TextBlock { Text = x.Name },
x => x.Children,
x => true),

2
samples/XamlTestApplication/Program.cs

@ -40,7 +40,7 @@ namespace XamlTestApplication
{
DataTemplates = new DataTemplates
{
new TreeDataTemplate<Node>(
new FuncTreeDataTemplate<Node>(
x => new TextBlock { Text = x.Name },
x => x.Children,
x => true),

2
src/Perspex.Controls/Generators/TreeItemContainerGenerator.cs

@ -199,7 +199,7 @@ namespace Perspex.Controls.Generators
if (treeTemplate == null)
{
treeTemplate = new TreeDataTemplate(typeof(object), template.Build, x => null);
treeTemplate = new FuncTreeDataTemplate(typeof(object), template.Build, x => null);
}
return treeTemplate;

4
src/Perspex.Controls/Perspex.Controls.csproj

@ -127,7 +127,7 @@
<Compile Include="Templates\ITemplate`2.cs" />
<Compile Include="Templates\ITemplate`1.cs" />
<Compile Include="Templates\ITreeDataTemplate.cs" />
<Compile Include="Templates\TreeDataTemplate.cs" />
<Compile Include="Templates\FuncTreeDataTemplate.cs" />
<Compile Include="ToolTip.cs" />
<Compile Include="UserControl.cs" />
<Compile Include="Templates\TemplateExtensions.cs" />
@ -154,7 +154,7 @@
<Compile Include="TextBox.cs" />
<Compile Include="Presenters\TextPresenter.cs" />
<Compile Include="Primitives\ToggleButton.cs" />
<Compile Include="Templates\TreeDataTemplate`1.cs" />
<Compile Include="Templates\FuncTreeDataTemplate`1.cs" />
<Compile Include="TreeView.cs" />
<Compile Include="TreeViewItem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

18
src/Perspex.Controls/Templates/TreeDataTemplate.cs → src/Perspex.Controls/Templates/FuncTreeDataTemplate.cs

@ -10,14 +10,14 @@ namespace Perspex.Controls.Templates
/// <summary>
/// A template used to build hierachical data.
/// </summary>
public class TreeDataTemplate : FuncDataTemplate, ITreeDataTemplate
public class FuncTreeDataTemplate : FuncDataTemplate, ITreeDataTemplate
{
private readonly Func<object, IEnumerable> _itemsSelector;
private readonly Func<object, bool> _isExpanded;
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate"/> class.
/// </summary>
/// <param name="type">The type of data which the data template matches.</param>
/// <param name="build">
@ -27,7 +27,7 @@ namespace Perspex.Controls.Templates
/// A function which when passed an object of <paramref name="type"/> returns the child
/// items.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Type type,
Func<object, IControl> build,
Func<object, IEnumerable> itemsSelector)
@ -36,7 +36,7 @@ namespace Perspex.Controls.Templates
}
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate"/> class.
/// </summary>
/// <param name="type">The type of data which the data template matches.</param>
/// <param name="build">
@ -50,7 +50,7 @@ namespace Perspex.Controls.Templates
/// A function which when passed an object of <paramref name="type"/> returns the the
/// initial expanded state of the node.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Type type,
Func<object, IControl> build,
Func<object, IEnumerable> itemsSelector,
@ -60,7 +60,7 @@ namespace Perspex.Controls.Templates
}
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate"/> class.
/// </summary>
/// <param name="match">
/// A function which determines whether the data template matches the specified data.
@ -71,7 +71,7 @@ namespace Perspex.Controls.Templates
/// <param name="itemsSelector">
/// A function which when passed a matching object returns the child items.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Func<object, bool> match,
Func<object, IControl> build,
Func<object, IEnumerable> itemsSelector)
@ -81,7 +81,7 @@ namespace Perspex.Controls.Templates
}
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate"/> class.
/// </summary>
/// <param name="match">
/// A function which determines whether the data template matches the specified data.
@ -96,7 +96,7 @@ namespace Perspex.Controls.Templates
/// A function which when passed a matching object returns the the initial expanded state
/// of the node.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Func<object, bool> match,
Func<object, IControl> build,
Func<object, IEnumerable> itemsSelector,

18
src/Perspex.Controls/Templates/TreeDataTemplate`1.cs → src/Perspex.Controls/Templates/FuncTreeDataTemplate`1.cs

@ -10,10 +10,10 @@ namespace Perspex.Controls.Templates
/// A template used to build hierachical data.
/// </summary>
/// <typeparam name="T">The type of the template's data.</typeparam>
public class TreeDataTemplate<T> : TreeDataTemplate
public class FuncTreeDataTemplate<T> : FuncTreeDataTemplate
{
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate{T}"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate{T}"/> class.
/// </summary>
/// <param name="build">
/// A function which when passed an object of <typeparamref name="T"/> returns a control.
@ -22,7 +22,7 @@ namespace Perspex.Controls.Templates
/// A function which when passed an object of <typeparamref name="T"/> returns the child
/// items.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Func<T, Control> build,
Func<T, IEnumerable> itemsSelector)
: base(
@ -33,7 +33,7 @@ namespace Perspex.Controls.Templates
}
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate{T}"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate{T}"/> class.
/// </summary>
/// <param name="build">
/// A function which when passed an object of <typeparamref name="T"/> returns a control.
@ -46,7 +46,7 @@ namespace Perspex.Controls.Templates
/// A function which when passed an object of <typeparamref name="T"/> returns the the
/// initial expanded state of the node.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Func<T, Control> build,
Func<T, IEnumerable> itemsSelector,
Func<T, bool> isExpanded)
@ -59,7 +59,7 @@ namespace Perspex.Controls.Templates
}
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate{T}"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate{T}"/> class.
/// </summary>
/// <param name="match">
/// A function which determines whether the data template matches the specified data.
@ -70,7 +70,7 @@ namespace Perspex.Controls.Templates
/// <param name="itemsSelector">
/// A function which when passed a matching object returns the child items.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Func<T, bool> match,
Func<T, Control> build,
Func<T, IEnumerable> itemsSelector)
@ -82,7 +82,7 @@ namespace Perspex.Controls.Templates
}
/// <summary>
/// Initializes a new instance of the <see cref="TreeDataTemplate{T}"/> class.
/// Initializes a new instance of the <see cref="FuncTreeDataTemplate{T}"/> class.
/// </summary>
/// <param name="match">
/// A function which determines whether the data template matches the specified data.
@ -97,7 +97,7 @@ namespace Perspex.Controls.Templates
/// A function which when passed a matching object returns the the initial expanded state
/// of the node.
/// </param>
public TreeDataTemplate(
public FuncTreeDataTemplate(
Func<T, bool> match,
Func<T, Control> build,
Func<T, IEnumerable> itemsSelector,

2
src/Perspex.Diagnostics/Views/LogicalTreeView.cs

@ -48,7 +48,7 @@ namespace Perspex.Diagnostics.Views
{
DataTemplates = new DataTemplates
{
new TreeDataTemplate<LogicalTreeNode>(GetHeader, x => x.Children),
new FuncTreeDataTemplate<LogicalTreeNode>(GetHeader, x => x.Children),
},
[!ItemsControl.ItemsProperty] = this.WhenAnyValue(x => x.ViewModel.Nodes),
}),

2
src/Perspex.Diagnostics/Views/VisualTreeView.cs

@ -49,7 +49,7 @@ namespace Perspex.Diagnostics.Views
{
DataTemplates = new DataTemplates
{
new TreeDataTemplate<VisualTreeNode>(GetHeader, x => x.Children),
new FuncTreeDataTemplate<VisualTreeNode>(GetHeader, x => x.Children),
},
[!ItemsControl.ItemsProperty] = this.WhenAnyValue(x => x.ViewModel.Nodes),
}),

Loading…
Cancel
Save