0

I'm trying to open a view from my mainview in a button click command, I just need to know what i have to replace in my method GoToNewPage()

private DelegateCommand newPageCommand;

    public ICommand NewPage
    {

        get
        {

            if (newPageCommand == null)
            {
                newPageCommand = new DelegateCommand(GoToNewPage);
            }
            return newPageCommand;
        }
    }


    private void GoToNewPage()
    {
      //What i have to write there?
    }
  • It depends on the implementation. Advice - search for examples and you will find a lot of them. Also please take a minute and read [MCVE](https://stackoverflow.com/help/mcve). – Rekshino Dec 28 '18 at 07:10
  • https://stackoverflow.com/questions/19654295/wpf-mvvm-navigate-views – AmirHossein Rezaei Dec 28 '18 at 14:06

1 Answers1

-1
private void GoToNewPage()
{
    var window = new ViewClassName();
    window.Show();
}
  • While this code may answer the question, it is better to explain how to solve the problem and provide the code as an example or reference. Code-only answers can be confusing and lack context. – Robert Columbia Dec 30 '18 at 03:57