C#のWPFでTemplateをコードで作る
上記ページを参考にコードでDataTemplateを作り表示されました。

FrameworkElementFactory textBlock = new FrameworkElementFactory(typeof(TextBlock), "TextBlock");
textBlock.SetValue(TextBlock.MarginProperty, new Thickness(5, 5, 5, 5));
textBlock.SetValue(TextBlock.TextProperty, "テキスト本文");

FrameworkElementFactory image = new FrameworkElementFactory(typeof(Image), "Image");
BitmapImage bitmapImage = new BitmapImage(new Uri(イメージのURL));
imageElement.SetValue(Image.SourceProperty, bitmapImage);

FrameworkElementFactory stackPanel = new FrameworkElementFactory(typeof(StackPanel), "StackPanel");
stackPanel.AppendChild(textBlock);
stackPanel.AppendChild(image);

DataTemplate template = new DataTemplate();
template.VisualTree = stackPanel;

テキスト本文やbitmapImageを変えたい場合、どのようにすべきなのでしょうか?
また、DataTemplateからAppendChildの要素を取得、設定することは可能でしょうか?