I’m searching for a way to create a WPF Control with custom shape which will be able to contain child controls.
Simplifying the question, I need something like a non-rectangular panel.
UPDATE:
I need a “real” custom shape. Not to capture mouse events outside the shape and so on.
I would derive from ContentControl, and then as child in it i would put a content presenter, in the content presenter you can put any panel such as a canvas in which you can host other elements. I would do this as a Template applied to your control and would bind the content of the presenter to the content property of the control, in such a way adding to the content property of your control will add it to the presenter which will show it. Here is an example:
Then just apply the template to your control and you are all set, don’t forget to add a panel as the child to content if you want to host other elements in it.