Browse Source

The root of a control template has to be Control.

pull/4/head
grokys 12 years ago
parent
commit
c0b35a36ca
  1. 2
      Perspex.Windows/Window.cs
  2. 6
      Perspex/ControlTemplate.cs
  3. 2
      Perspex/Themes/Default/ButtonStyle.cs

2
Perspex.Windows/Window.cs

@ -80,7 +80,7 @@ namespace Perspex.Windows
UnmanagedMethods.ShowWindow(this.Handle, 4);
}
private Visual DefaultTemplate(Window c)
private Control DefaultTemplate(Window c)
{
Border border = new Border();
border.Background = new Perspex.Media.SolidColorBrush(0xffffffff);

6
Perspex/ControlTemplate.cs

@ -5,18 +5,18 @@
public class ControlTemplate
{
public ControlTemplate(Func<TemplatedControl, Visual> build)
public ControlTemplate(Func<TemplatedControl, Control> build)
{
this.Build = build;
}
public Func<TemplatedControl, Visual> Build
public Func<TemplatedControl, Control> Build
{
get;
private set;
}
public static ControlTemplate Create<TControl>(Func<TControl, Visual> build)
public static ControlTemplate Create<TControl>(Func<TControl, Control> build)
where TControl : TemplatedControl
{
return new ControlTemplate(c => build((TControl)c));

2
Perspex/Themes/Default/ButtonStyle.cs

@ -45,7 +45,7 @@ namespace Perspex.Themes.Default
});
}
private Visual Template(Button control)
private Control Template(Button control)
{
Border border = new Border();
border.SetValue(Border.BackgroundProperty, control.GetObservable(Button.BackgroundProperty));

Loading…
Cancel
Save