Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can i get the UI element from FrameorkelemntFactory as my code is
 FrameworkElementFactory objFrame = new FrameworkElementFactory(typeof(TextBlock));
                        objFrame.SetValue(TextBlock.TextProperty, "country");
objFrame.Name="somename";

 DataTemplate dt1 = new DataTemplate();                        
                        dt1.VisualTree = objFrame;        

if i want to access the text property of the TextBlock how can i do this?
i have tried something like
TextBlock txt = dt1.FindName("somename", (FrameworkElement)TextBlock) as TextBlock;

but its showing errors...
can anybody help me
thanks in advance........
Posted
Updated 25-Jul-13 18:06pm
v3

1 solution

You Can Try Follow Code.
dt1.LoadContent() as TextBlock;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900