I just checked online docs - Alun is right - use XamlReader. According to Microsoft, the FrameworkElementFactory class does not support all XAML functions and may be deprecated in the future.
Having said that, I used FrameworkElementFactory to change DataTemplates on the fly and had no problems.
source
share