Reputation: 9867
So if I create a button in XAML,
<Button />
I can set the content one of a few ways
<Button Content="My Content" />
<Button>
My Content
</Button>
<Button>
<Button.Content>
My Content
</Button.Content>
</Button>
and etc...
My question is, when a user passes content in this way
<Button>
My Content
</Button>
how does wpf know to assign the Content dependency property? This is pretty neat functionality I'd like to build into my controls.
Upvotes: 1
Views: 838
Reputation: 887897
This comes from the [ContentProperty("Content")]
attribute, which is set by ContentControl.
Upvotes: 4