// -----------------------------------------------------------------------
//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Controls.Templates
{
using System;
using System.Collections;
///
/// A template used to build hierachical data.
///
/// The type of the template's data.
public class TreeDataTemplate : TreeDataTemplate
{
///
/// Initializes a new instance of the class.
///
///
/// A function which when passed an object of returns a control.
///
///
/// A function which when passed an object of returns the child
/// items.
///
public TreeDataTemplate(
Func build,
Func itemsSelector)
: base(
typeof(T),
TreeDataTemplate.Cast(build),
TreeDataTemplate.Cast(itemsSelector))
{
}
///
/// Initializes a new instance of the class.
///
///
/// A function which when passed an object of returns a control.
///
///
/// A function which when passed an object of returns the child
/// items.
///
///
/// A function which when passed an object of returns the the
/// initial expanded state of the node.
///
public TreeDataTemplate(
Func build,
Func itemsSelector,
Func isExpanded)
: base(
typeof(T),
TreeDataTemplate.Cast(build),
TreeDataTemplate.Cast(itemsSelector),
TreeDataTemplate.Cast(isExpanded))
{
}
///
/// Initializes a new instance of the class.
///
///
/// A function which determines whether the data template matches the specified data.
///
///
/// A function which when passed a matching object returns a control.
///
///
/// A function which when passed a matching object returns the child items.
///
public TreeDataTemplate(
Func match,
Func build,
Func itemsSelector)
: base(
TreeDataTemplate.CastMatch(match),
TreeDataTemplate.Cast(build),
TreeDataTemplate.Cast(itemsSelector))
{
}
///
/// Initializes a new instance of the class.
///
///
/// A function which determines whether the data template matches the specified data.
///
///
/// A function which when passed a matching object returns a control.
///
///
/// A function which when passed a matching object returns the child items.
///
///
/// A function which when passed a matching object returns the the initial expanded state
/// of the node.
///
public TreeDataTemplate(
Func match,
Func build,
Func itemsSelector,
Func isExpanded)
: base(
TreeDataTemplate.CastMatch(match),
TreeDataTemplate.Cast(build),
TreeDataTemplate.Cast(itemsSelector),
TreeDataTemplate.Cast(isExpanded))
{
}
///
/// Casts a typed match function to an untyped match function.
///
/// The typed function.
/// The untyped function.
private static Func