|
|
@@ -307,6 +307,23 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
|
|
|
Assert.Equal("child", child.Name);
|
|
|
}
|
|
|
|
|
|
+ [Fact]
|
|
|
+ public void ControlTemplate_With_TargetType_Is_Operational()
|
|
|
+ {
|
|
|
+ var xaml = @"
|
|
|
+<ControlTemplate xmlns='https://github.com/avaloniaui'
|
|
|
+ xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
|
|
|
+ TargetType='{x:Type ContentControl}'>
|
|
|
+ <ContentPresenter Content='{TemplateBinding Content}' />
|
|
|
+</ControlTemplate>
|
|
|
+";
|
|
|
+ var template = AvaloniaXamlLoader.Parse<ControlTemplate>(xaml);
|
|
|
+
|
|
|
+ Assert.Equal(typeof(ContentControl), template.TargetType);
|
|
|
+
|
|
|
+ Assert.IsType(typeof(ContentPresenter), template.Build(new ContentControl()).Control);
|
|
|
+ }
|
|
|
+
|
|
|
[Fact]
|
|
|
public void ControlTemplate_With_Panel_Children_Are_Added()
|
|
|
{
|