c# - wpf 如何知道设置 Content 属性

标签 c# wpf

所以如果我在 XAML 中创建一个按钮,

<Button />

我可以通过几种方式之一设置内容

<Button Content="My Content" />

<Button>
    My Content
</Button>

<Button>
   <Button.Content>
         My Content
   </Button.Content>
</Button>

等等...

我的问题是,当用户以这种方式传递内容时

<Button>
    My Content
</Button>

wpf 如何知道分配 Content 依赖属性?这是我想构建到我的控件中的非常巧妙的功能。

最佳答案

关于c# - wpf 如何知道设置 Content 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37929349/

相关文章:

c# - 更改禁用文本框的颜色

c# - 再次提供多线程帮助 (winForms)

c# - Financial.IRR 未在 C# 中计算

c# - 编译 .NET 程序集时,名称中包含 x__ 的类是什么?

WPF DataGrid 闪烁问题

c# - 带有附加属性的疑问

c# - 并非所有 CSS 代码都适用于 WebBrowser WPF C#

c# - 从字符串而不是 TextReader 反序列化

wpf - 我应该使用 DataTemplates 还是 UserControl 来显示扩展类的不同控件?

c# - Windows 10 语音识别