开发者

How to apply style in WPF Grid's first row at run time

开发者 https://www.devze.com 2023-01-06 14:54 出处:网络
How to apply style in WPF Grid\'s first row a开发者_如何学Ct run time.Just do this - Style style = new Style(typeof(RowDefinition));

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

0

精彩评论

暂无评论...
验证码 换一张
取 消