I have this class:
public class EditorKey
{
public Type TargetType { get; set; }
public DataTemplate Template { get; set; }
}
Now, I want to create an instance of this class in XAML. Since in UWP we don't have the x:Type markup extension, I'm specifying the type directly as a string, with the correct prefix with TargetType="model:Customer"
<Page
x:Class="App8.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:model="using:App8"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<ContentControl>
<model:EditorKey TargetType="model:Customer" />
</ContentControl>
</Page>
Running this, I get a runtime exception:
Failed to create a 'App8.EditorKey' from the text 'model:Customer'.
How can I map the string to the actual Type?