I have some string representations of Xaml objects, and I want to build the controls. I\'m using the XamlReader.Parse function to do this. For a simple control such as Button th
It's a "feature" of the XAML language, it is declarative and doesn't know anything about constructors.
People use ObjectDataProvider in XAML to "translate" and wrap instances of classes that do not have a parameterless constructor (it's also useful for data binding).
In your case the XAML should look approximately like this:
And the code should be:
var stroke = (Stroke) ((ObjectDataProvider)XamlReader.Parse(xamlStr)).Data;
HTH.