How to center dialog on parent

Topics: Getting Started
Aug 21, 2012 at 11:43 AM
Edited Aug 21, 2012 at 11:43 AM

Hello,

I have an DockWindow like application and try to show a centered dialog on an content pane which resides outside the documenthost.

WindowManager wm = new WindowManager();
MyViewModel myVM = new MyViewModel();      
wm.ShowDialog(myVM);

This shows the dialog always centered on the main window. 
How can I set the contant pane as parent?

dynamic settings = new ExpandoObject();
settings.Placement = PlacementMode.Center;
settings.PlacementTarget = GetView(null);

windowManager.ShowPopup(new DialogViewModel(), "Popup", settings);

I think this only works for popups :(