I am creating 'n' number of textblocks inside a stack panel programmatically. I need to change change the font size(both increase and decrease of font size) of 'n' textblocks. Is it possible to change font size of all child's of stack panel in single statement? If not possible how it can be solved efficiently ?
Yes, You can refer the code snippet below, where 'foobar' refers to your Stackpanel's Name.
foreach (var children in foobar.Children)
{
(children as TextBlock).FontSize = 20;
}