【问题标题】:WPF C# Set "ContentPresenter.Foreground" by codeWPF C#通过代码设置“ContentPresenter.Foreground”
【发布时间】:2015-02-04 10:35:44
【问题描述】:

我只能使用 TextElement.Foreground="..." 找到针对此问题的 xaml 特定解决方案。
但我想在 C# 中设置 ContentPresenter 的前景。
你能告诉我它是如何工作的吗?

非常感谢!

【问题讨论】:

标签: c# wpf foreground contentpresenter


【解决方案1】:

附加的属性是您正在寻找的。你可以查看msdn

一般来说,您需要执行类似 myContentPresenter.SetValue(ForegroundProperty, myForeground) 的操作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-10
    • 1970-01-01
    • 1970-01-01
    • 2011-06-05
    相关资源
    最近更新 更多