【发布时间】:2010-12-16 07:23:05
【问题描述】:
有谁知道如何在后面的代码中创建 wpf 样式,我在网络或 MSDN 文档上找不到任何东西。我已经尝试过了,但它不起作用:
Style s = new Style(typeof(TextBlock));
s.RegisterName("Foreground", Brushes.Green);
s.RegisterName("Text", "Green");
breakInfoControl.dataTextBlock.Style = s;
【问题讨论】:
标签: c# .net wpf styles code-behind