Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 4d28820

Browse files
author
gumme
committed
Added test that loads xaml with an explicit list. The official XamlReader can read it successfully but the own XamlParser fails and should be fixed.
1 parent 21a4a33 commit 4d28820

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/ExampleClassContainer.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
namespace ICSharpCode.WpfDesign.Tests.XamlDom
99
{
10+
public class ExampleClassList : List<ExampleClass>
11+
{
12+
}
13+
1014
[ContentProperty("List")]
1115
public class ExampleClassContainer : ExampleClass
1216
{
@@ -18,5 +22,18 @@ public List<ExampleClass> List {
1822
return list;
1923
}
2024
}
25+
26+
ExampleClassList otherList = new ExampleClassList();
27+
28+
public ExampleClassList OtherList {
29+
get {
30+
TestHelperLog.Log("OtherList.get " + Identity);
31+
return otherList;
32+
}
33+
set {
34+
TestHelperLog.Log("OtherList.set " + Identity);
35+
otherList = value;
36+
}
37+
}
2138
}
2239
}

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/SimpleLoadTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,24 @@ public void ContainerImplicitList()
190190
");
191191
}
192192

193+
[Test]
194+
public void ContainerExplicitList()
195+
{
196+
TestLoading(@"
197+
<ExampleClassContainer
198+
xmlns=""" + XamlTypeFinderTests.XamlDomTestsNamespace + @"""
199+
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
200+
<ExampleClassContainer.OtherList>
201+
<ExampleClassList>
202+
<ExampleClass OtherProp=""a""> </ExampleClass>
203+
<ExampleClass OtherProp=""b"" />
204+
<ExampleClass OtherProp=""c"" />
205+
</ExampleClassList>
206+
</ExampleClassContainer.OtherList>
207+
</ExampleClassContainer>
208+
");
209+
}
210+
193211
[Test]
194212
public void ExampleServiceTest()
195213
{

0 commit comments

Comments
 (0)