Definindo a fonte do pai nos nós no WPF Tree View como Negrito usando o código por trás

Fiz uma exibição em árvore e adicionei nós pai e filho a tudo isso usando o código por trás, agora que estou preso é definir a fonte dos nós pais comoBOLD enquanto mantém a fonte do child como ela é, abaixo está o código que eu tenho agora.

List<ParentTreeViewNode> ParentTreeViewNodeList = new List<ParentTreeViewNode>();

HierarchicalDataTemplate treeViewTemplate = new HierarchicalDataTemplate(typeof(Child));
treeViewTemplate.DataType = "{x:Type local:Child}";
treeViewTemplate.ItemsSource = new Binding("Children");

FrameworkElementFactory tb = new FrameworkElementFactory(typeof(TextBlock));
tb.SetBinding(TextBlock.TextProperty, new Binding("Name"));
tb.SetValue(TextBlock.ForegroundProperty, Brushes.Yellow);
treeViewTemplate.VisualTree = tb;

DataTemplate parentTemplate = new DataTemplate(typeof(ParentTreeViewNode));
parentTemplate.DataType = "{x:Type local:ParentTreeViewNode}";
//parentTemplate.ItemsSource = new Binding("Children");

FrameworkElementFactory tbp = new FrameworkElementFactory(typeof(TextBlock));
tbp.SetBinding(TextBlock.TextProperty, new Binding("Name"));
tbp.SetValue(TextBlock.ForegroundProperty, Brushes.Green);
treeViewTemplate.VisualTree = tbp;


// ParentTreeViewNode1.Children = Childlist1;

ParentTreeViewNodeList.Add(new ParentTreeViewNode("Paren1"));
ParentTreeViewNodeList.Add(new ParentTreeViewNode("Paren2"));
ParentTreeViewNodeList.Add(new ParentTreeViewNode("Paren3"));

//arrayTreeView.ItemTemplate = treeViewTemplate;
arrayTreeView.Resources.Add(1,treeViewTemplate);
arrayTreeView.Resources.Add(2,treeViewTemplate);
arrayTreeView.ItemsSource = ParentTreeViewNodeList;  

Este é o link de onde recebi ajuda:http://zamjad.wordpress.com/2009/12/06/using-hierarchical-data-template-with-c-code/#comment-446

obrigado

questionAnswers(3)

yourAnswerToTheQuestion