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;

 

你可能感兴趣的:(resource)