I could use FrameworkElementFactory to create a template, but this class is deprecated. The recommended way, according to MSDN is to use XamlReader.Load to load XAML from a string or a memory stream. I get this to work, but think this is kind of sad:
string xaml = "a lot of XAML";
Any suggestions to be able to do this in a better way?
What I really want to do is be able to dynamically change a Binding path in a DataTemplate.
<DataTemplate x:Key="DataTemplate1">
<StackPanel>
<TextBlock>Some text</TextBlock>
<TextBlock Text="{Binding ThePathIWantToChange}"/>
</StackPanel>
</DataTemplate>