What is a “default dependency property” in XAML?

(this is related to the Universal Windows framework in case it makes a difference)

When you make a grid, you can specify things in this way:

<Grid Background="0xFFFFFFFF"> <Button/> </Grid> 

I'm aware that the "Background" element in the aforementioned code is a standard dependency property in the class of "Grid" (or maybe it's base class, but you know what I mean) – but what is the "Button" element? Obviously it's a child control of "Grid" – but how do I go about implementing a syntax like this in a custom user control where I can simply wrap a child element when I use my user control? Is that built in to classes that inherit from "Control?"

In my user control XAML, how do I tell it how and where to lay out a child element which is assigned in this manner?

by HonorableJudgeHolden via /r/csharp

Leave a Reply