WPF FAQ - Custom Controls

How do I make the UserControl B FILL the UserControl A it’s hosted in?

You can bind B’s Width and Height to that of A’s. For example, in the XAML where you define B:

[XAML]
<local:B Width='{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type A}}, Path=Width}' /local:B>

If there is an ActualWidth property in A, then you might want to bind B’s Width to that instead. Do the same for Height.

Permalink
Is there a good PropertyGrid implementation I could use in my applications?

This blog has a good PropertyGrid implementation:

Your own WPF PropertyGrid control in a couple of hours

Permalink