I want to know how can I navigate between pages in a frame sending parameters.
I've tried this on my Navigation View:
if (tag != null)
{
switch (tag)
{
case "Users":
User user = new User();
MainFrame.Navigate(typeof(UserManagementPage), user);
break;
}
In the View (Page) I just have this code:
public UserManagementPage(User user)
{
this.InitializeComponent();
}
When I click on the NavigationViewItem
that was supposed to navigate the frame to the UserManagementPage
the app throws the following exception:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
at MainFrame.Navigate(typeof(UserManagementPage), user);
I've tried to remove the parameter from the page constructor and it worked fine so I think the problem is on the way I'm trying to send the parameter.
Anyone knows how can I do this right?
PS: The problem isn't on the frame because all the other pages are working fine.