|
|
|
@ -208,6 +208,88 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
@@ -208,6 +208,88 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
|
|
|
|
|
");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ContainerImplicitDictionary() |
|
|
|
|
{ |
|
|
|
|
TestLoading(@"
|
|
|
|
|
<ExampleClassContainer |
|
|
|
|
xmlns=""" + XamlTypeFinderTests.XamlDomTestsNamespace + @""" |
|
|
|
|
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
|
|
|
|
|
<ExampleClassContainer.Dictionary> |
|
|
|
|
<ExampleClass x:Key=""key1"" OtherProp=""a""> </ExampleClass> |
|
|
|
|
<ExampleClass x:Key=""key2"" OtherProp=""b"" /> |
|
|
|
|
<ExampleClass x:Key=""key3"" OtherProp=""c"" /> |
|
|
|
|
</ExampleClassContainer.Dictionary> |
|
|
|
|
</ExampleClassContainer> |
|
|
|
|
");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ContainerExplicitDictionary() |
|
|
|
|
{ |
|
|
|
|
TestLoading(@"
|
|
|
|
|
<ExampleClassContainer |
|
|
|
|
xmlns=""" + XamlTypeFinderTests.XamlDomTestsNamespace + @""" |
|
|
|
|
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
|
|
|
|
|
<ExampleClassContainer.Dictionary> |
|
|
|
|
<ExampleClassDictionary> |
|
|
|
|
<ExampleClass x:Key=""key1"" OtherProp=""a""> </ExampleClass> |
|
|
|
|
<ExampleClass x:Key=""key2"" OtherProp=""b"" /> |
|
|
|
|
<ExampleClass x:Key=""key3"" OtherProp=""c"" /> |
|
|
|
|
</ExampleClassDictionary> |
|
|
|
|
</ExampleClassContainer.Dictionary> |
|
|
|
|
</ExampleClassContainer> |
|
|
|
|
");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ResourceDictionaryImplicit() |
|
|
|
|
{ |
|
|
|
|
TestLoading(@"
|
|
|
|
|
<Window |
|
|
|
|
xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
|
|
|
|
|
xmlns:t=""" + XamlTypeFinderTests.XamlDomTestsNamespace + @""" |
|
|
|
|
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
|
|
|
|
|
<Window.Resources> |
|
|
|
|
<t:ExampleClass x:Key=""key1"" OtherProp=""a""> </t:ExampleClass> |
|
|
|
|
<t:ExampleClass x:Key=""key2"" OtherProp=""b"" /> |
|
|
|
|
</Window.Resources> |
|
|
|
|
</Window> |
|
|
|
|
");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ResourceDictionaryExplicitWinfx2006() |
|
|
|
|
{ |
|
|
|
|
ResourceDictionaryExplicitInternal("http://schemas.microsoft.com/winfx/2006/xaml/presentation"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
[Ignore("Own XamlParser should handle different namespaces pointing to same types, because builtin XamlReader does.")] |
|
|
|
|
public void ResourceDictionaryExplicitNetfx2007() |
|
|
|
|
{ |
|
|
|
|
// The reason this test case fails is because own XamlParser cannot always handle the case where multiple xmlns points to the same type.
|
|
|
|
|
// In this test case the default xmlns is set to netfx/20007 (compare with the test above that uses winfx/2006 and is successfully executed).
|
|
|
|
|
ResourceDictionaryExplicitInternal("http://schemas.microsoft.com/netfx/2007/xaml/presentation"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ResourceDictionaryExplicitInternal(string defaultXmlns) |
|
|
|
|
{ |
|
|
|
|
TestLoading(@"
|
|
|
|
|
<Window |
|
|
|
|
xmlns=""" + defaultXmlns + @""" |
|
|
|
|
xmlns:t=""" + XamlTypeFinderTests.XamlDomTestsNamespace + @""" |
|
|
|
|
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
|
|
|
|
|
<Window.Resources> |
|
|
|
|
<ResourceDictionary> |
|
|
|
|
<t:ExampleClass x:Key=""key1"" OtherProp=""a""> </t:ExampleClass> |
|
|
|
|
<t:ExampleClass x:Key=""key2"" OtherProp=""b"" /> |
|
|
|
|
</ResourceDictionary> |
|
|
|
|
</Window.Resources> |
|
|
|
|
</Window> |
|
|
|
|
");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void ExampleServiceTest() |
|
|
|
|
{ |
|
|
|
|