How to apply style in WPF Grid's first row at run time.
A:
Just do this -
Style style = new Style(typeof(RowDefinition));
style.Setters.Add(new Setter(RowDefinition.HeightProperty, 10));
yourGrid.RowDefinitions[0].Style = style;
Update:
You can use FrameworkElement.FindResource Method[ http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.findresource.aspx ] to find your style.
Check this for more details -
Resources and Code [ http://msdn.microsoft.com/en-us/library/ms752326.aspx ]
akjoshi
2010-07-08 10:16:47
i have already defined a style in a "myTheame.xaml" so at runtime how to read style from "myTheame.xaml" and to apply it on grid's row.
Jeevan Bhatt
2010-07-08 10:55:50
Updated Answer for this.
akjoshi
2010-07-08 12:03:30