I am trying to create a "titled block" UserControl in WPF/XAML, with the following behaviour:
- The control itself is a Border containing a DockPanel. The DockPanel contains a top-aligned "title" TextBlock, and the rest of this DockPanel should be the "children widget area".
The control declaration is like this:
<Border x:Name="LayoutRoot" Background="#4C000000" CornerRadius="10" Padding="10"> <DockPanel> <TextBlock Text="Some Title" DockPanel.Dock="Top" /> </DockPanel> </Border> And the intended usage is like this:
<Grid x:Name="LayoutRoot" Background="White"> <local:Bloco Height="100" Width="100" Title="Other Title"> <local:Bloco Title="Yet other title" /> </local:Bloco> </Grid> To render something like this:

The actual current rendering is invalid, though. The problems are:
- I don't know (and didn't found it via searching) how to make the control have a "children container" where I could add children via direct nesting in the XAML;
- I don't know how to bind a different title for each instance of the user control, be it via XAML attributes or bindings (preferrable), be it via code behind. Writing the code as above creates invalid xaml code, which is unsurprising since the "Title" attribute does not exist yet.
Thanks for reading!