WPF 后台读取样式文件

原文:WPF 后台读取样式文件

ResourceDictionary dic = new ResourceDictionary { Source = new Uri("Styles.xaml",UriKind.Relative) };
Style style = (Style)dic["TextBlockStyle"];
ResourceDictionary dic0 = (ResourceDictionary)System.Windows.Application.LoadComponent(new Uri("Styles.xaml", UriKind.RelativeOrAbsolute));
Style style0 = (Style)dic0["TextBlockStyle"];

 

上一篇:android – 基线对齐的TextInputLayout和Spinner


下一篇:c# – 在DataGridView上更改RowHeader背景颜色,而不会丢失默认样式