I'm developing a WPF application with MVVM and PRISM 7.
At some places I'd like to open a new Window.xaml
with the click of a button.
So I've created that Window.xaml
and am calling it like so when clicking that button/command:
private void OnInstrumentFinderCommand()
{
var instrumentfinder = new InstrumentFinderWindow();
var result = instrumentfinder.ShowDialog();
if (result == true)
{
// logic here...
}
}
That works fine. The InstrumentFinderWindow
opens up and I can interact with it.
But this breaks the loosely coupling which I want to achieve with MVVM.
I know how to use PRISM with View
s and Module
s, but cannot figure out how I have to handle the Window
to achieve the same result as the code above, but loosely coupled resp. not calling it directly from within a ViewModel
.
Is there even a way or do I have to handle this completely different?
EDIT:
I just want to make clear, that I'm asking about a way to call a System.Windows.Window
a MVVM/PRISM-way. Not about a "Yes/No/Cancel" popup dialog.