Style 的查找 FindResource

1)根据名称查找

 PrintPreview fe = new PrintPreview(new Summary());
 string strResourceHeader = "headerStyle" + styleSize.ToString();

 HeaderStyle = (Style)fe.FindResource(strResourceHeader);

2)根据名称直接获取

 Style baseStyle = this.Resources["gridRowStyle"] as Style;

Style 的查找 FindResource

上一篇:ListView 控件与 内容


下一篇:ItemsControl