The Circumstances
I'm building a plugin for a WPF application. The parent application has a ContentPresenter and my plugin returns a UserControl. When the parent app runs, it loads up my plugin and places my UserControl inside the ContentPresenter.
The Problem
The problem is that my UserControl is not resized to fit within the ContentPresenter, so when the ContentPresenter is too small to show everything, my UserControl is simply cut off. If the app is resized so that the ContentPresenter becomes bigger than my UserControl, then I get a bunch of whitespace around my UserControl.
Basically, I want my UserControl to act as if it was inside a DockPanel.
What I've Tried
Both the ContentPresenter and the UserControl have Horizontal and Vertical alignments set to Stretch already.
I can achieve the desired result if I wrap my UserControl in a ViewBox, but I don't really know if that's the right way to do it. It feels like I'm missing out on some basic layout principle (which might just be a holdover from my Winforms days). Is there any "proper" way to achieve a docking effect within a ContentPresenter element?
EDIT: I want to emphasize that this is not a ContentControl vs. ContentPresenter issue. I cannot change out the ContentPresenter element because it is part of the parent application. The only thing I can control is the contents of my own plugin which are being placed within the ContentPresenter element. The developers of the parent application might allow me LIMITED access to the ContentPresenter if I need to adjust a property by traversing up the visual tree at runtime, but they've already stated that they don't want plugins navigating outside of their own scope of controls. This isn't as much of a technical limitation as a their-terms-and-conditions-won't-allow-it limitation.