This is my first MVVM app, and I am wondering how to switch to another view after the user is done with the OpenFileDialog
.
The changing view technique currently using is borrowed from here.
In other word, how to call :
private void ExecuteGridViewCommand()
{
CurrentViewModel = MainViewModel._gridViewModel;
}
The problem rises since I couldn't track when the user clicks the Open button of the Dialog since the Dialog is not a XAML control.
private static ViewModelBase _currentViewModel;
public ViewModelBase CurrentViewModel
{
get { return _currentViewModel; }
set
{
if (_currentViewModel != value)
{
_currentViewModel = value;
OnPropertyChanged();
}
}
}