6 changed files with 46 additions and 25 deletions
@ -0,0 +1,25 @@ |
|||
namespace Perspex |
|||
{ |
|||
using System; |
|||
using Perspex.Controls; |
|||
|
|||
public class ControlTemplate |
|||
{ |
|||
public ControlTemplate(Func<TemplatedControl, Visual> build) |
|||
{ |
|||
this.Build = build; |
|||
} |
|||
|
|||
public Func<TemplatedControl, Visual> Build |
|||
{ |
|||
get; |
|||
private set; |
|||
} |
|||
|
|||
public static ControlTemplate Create<TControl>(Func<TControl, Visual> build) |
|||
where TControl : TemplatedControl |
|||
{ |
|||
return new ControlTemplate(c => build((TControl)c)); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue