wpflayoutmvvmwpf-positioning

how to absolute position a dialog view in WPF MVVM


So, i have all of my controls nicely laid out using grids and stack panels.

In some cases, i would like to show a dialog layer (to add preferences etc). It does not need to be modal, and it does not need to have transparent background.. i just need it to be nice, unobtrusive, and positioned absolutely..

the only way i can think of to position such dialog control absolutely, is using a canvas, which i am not using. i need it to show on top of regularly laid out controls..

What are some options?


Solution

  • You can either use a popup control (set the PlacementRectangle value to position the content) or the Adorner layer to do this. The adorner technique is described here: http://bignickolson.com/2009/10/15/overlaying-controls-in-wpf-with-adorners/