Exception: Cannot create unknown type error "'{http://schemas.telerik.com/2008/xaml/presentation}RadDatePicker'"
public static object Visualize(string filepath)
{
try
{
var xdoc = new XDocument(XElement.Parse(new StreamReader(filepath).ReadToEnd()));
Code = xdoc.ToString();
XmlReader xmlReader = xdoc.CreateReader();
return XamlReader.Load(xmlReader); //<-- thrown here
}
catch(Exception e)
{
System.Windows.MessageBox.Show(e.Message,"Visualize error", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
return null;
}
}
Exception occurs during runtime when I call the above method with a xaml file that contains this component. If I call this same file, but the part where components are declared is missing, it works fine.
How do I fix it?
The issue may come from your own XAML code which expects a resource not existing on your XAML. If you have a merged resource on your App.xaml, don't expect that it will be seen by XAML control. I ran into the same issue which I had to explicitly define that merged resource again on my control XAML view.
My issue is below, kind of misleading to the actual cause.
Cannot create unknown type '{http://schemas.telerik.com/2008/xaml/presentation}RadGridView'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.