diff --git a/src/SourceGenerators/XamlGenerationTests/TypeConvertersControl.cs b/src/SourceGenerators/XamlGenerationTests/TypeConvertersControl.cs
new file mode 100644
index 000000000000..d7882a8fbec8
--- /dev/null
+++ b/src/SourceGenerators/XamlGenerationTests/TypeConvertersControl.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Windows.UI.Xaml;
+
+namespace XamlGenerationTests
+{
+ public partial class TypeConvertersControl : FrameworkElement
+ {
+ public Type TypeProperty { get; set; }
+
+ public Uri UriProperty { get; set; }
+ }
+}
diff --git a/src/SourceGenerators/XamlGenerationTests/TypeConvertersTests.xaml b/src/SourceGenerators/XamlGenerationTests/TypeConvertersTests.xaml
new file mode 100644
index 000000000000..0193c3fa272a
--- /dev/null
+++ b/src/SourceGenerators/XamlGenerationTests/TypeConvertersTests.xaml
@@ -0,0 +1,22 @@
+
+
+
+
diff --git a/src/Uno.UI.Tests/Uno.UI.Tests.csproj b/src/Uno.UI.Tests/Uno.UI.Tests.csproj
index f0fc01c1fde3..d13a4fa0a6bc 100644
--- a/src/Uno.UI.Tests/Uno.UI.Tests.csproj
+++ b/src/Uno.UI.Tests/Uno.UI.Tests.csproj
@@ -95,6 +95,7 @@
+
diff --git a/src/Uno.UI.Tests/XamlReaderTests/Given_XamlReader.cs b/src/Uno.UI.Tests/XamlReaderTests/Given_XamlReader.cs
index cbc667fae721..62cbfee14ec3 100644
--- a/src/Uno.UI.Tests/XamlReaderTests/Given_XamlReader.cs
+++ b/src/Uno.UI.Tests/XamlReaderTests/Given_XamlReader.cs
@@ -681,15 +681,27 @@ public void When_NonDependencyProperty_Binding()
Assert.AreEqual("Text", inner.MyBinding.Path.Path);
}
+ [TestMethod]
+ public void When_TypeConverters()
+ {
+ var s = GetContent(nameof(When_TypeConverters));
+ var r = Windows.UI.Xaml.Markup.XamlReader.Load(s) as UserControl;
+
+ var root = (TypeConvertersControl)r.Content;
+
+ Assert.AreEqual(typeof(TypeConvertersControl), root.TypeProperty);
+ Assert.AreEqual(new Uri("https://platform.uno/"), root.UriProperty);
+ }
+
private string GetContent(string testName)
- {
- var assembly = this.GetType().Assembly;
- var name = $"{GetType().Namespace}.{testName}.xamltest";
- // "Uno.UI.Tests.XamlReaderTests.BasicReader.xamltest"
- using (var stream = assembly.GetManifestResourceStream(name))
- {
- return stream.ReadToEnd();
- }
- }
- }
+ {
+ var assembly = this.GetType().Assembly;
+ var name = $"{GetType().Namespace}.{testName}.xamltest";
+ // "Uno.UI.Tests.XamlReaderTests.BasicReader.xamltest"
+ using (var stream = assembly.GetManifestResourceStream(name))
+ {
+ return stream.ReadToEnd();
+ }
+ }
+ }
}
diff --git a/src/Uno.UI.Tests/XamlReaderTests/TypeConvertersControl.cs b/src/Uno.UI.Tests/XamlReaderTests/TypeConvertersControl.cs
new file mode 100644
index 000000000000..14b2948ce3fb
--- /dev/null
+++ b/src/Uno.UI.Tests/XamlReaderTests/TypeConvertersControl.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Uno.UI.Tests.XamlReaderTests
+{
+ public class TypeConvertersControl : FrameworkElement
+ {
+ public Type TypeProperty { get; set; }
+
+ public Uri UriProperty { get; set; }
+ }
+}
diff --git a/src/Uno.UI.Tests/XamlReaderTests/When_TypeConverters.xamltest b/src/Uno.UI.Tests/XamlReaderTests/When_TypeConverters.xamltest
new file mode 100644
index 000000000000..2ca380eaa98b
--- /dev/null
+++ b/src/Uno.UI.Tests/XamlReaderTests/When_TypeConverters.xamltest
@@ -0,0 +1,14 @@
+
+
+
+