As far as I know, if you want to avoid defining the size in code in order to make it more flexible to its content size, you could try for example, instead of defining the
Height and Width manually, modifying the
WindowWrapper class, by adding the following line to its Show method:
public void Show()
//Specifies that a window will automatically set both its width and height
//to fit the width and height of its content.
this.window.SizeToContent = SizeToContent.WidthAndHeight;
In my opinion the main benefit of using this approach is that it allows you to loosely compose the UI, as you will be able to show a dialog using the UI functionalities provided by
Prism through the use of Regions.
On the other hand, also another alternative if you need to need to notify the user of the occurrence of an event, for example by displaying a dialog, could be using
You can find more information about this approach in the following chapter of the Prism documentation at MSDN:
Additionally, you can find a WPF sample that portrays the use of
InteractionRequest to display a dialog in Karl Shifflet's
In The Box MVVM Training (in the MVVM Scenarios Section).
I hope you find this handy,