How to apply style in WPF Grid's first row at run time
How to apply style in WPF Grid's first row a开发者_如何学Ct run time.
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 to find your style.
Check this for more details -
Resources and Code
精彩评论