I have written a WPF user control and part of it involves dynamically adding elements to a canvas which effects the height of said canvas. The canvas is nested within a grid
You need to override MeasureOverride method of your control and return your desired size (the size of your canvas) from there. Then the parent control would resize itself to accommodate it's child (if it can).