You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
App.Current.DispatcherUnhandledException +=OnDispatcherUnhandledException;
AppDomain.CurrentDomain.UnhandledException +=OnAppDomainUnhandledException;privatevoidOnDispatcherUnhandledException(objectsender,DispatcherUnhandledExceptionEventArgse){// Handle the exception and show an error message
ShowErrorMessage("An unexpected error occurred: "+ e.Exception.Message);
e.Handled =true;// Mark the exception as handled}privatevoidOnAppDomainUnhandledException(objectsender,UnhandledExceptionEventArgse){// Handle the exception and show an error messageif(e.ExceptionObject is Exception ex){
ShowErrorMessage("An unexpected error occurred: "+ ex.Message);}}privatevoidShowErrorMessage(stringmessage){// You can customize this to show a dialog or error window
System.Windows.MessageBox.Show(message,"Error", System.Windows.MessageBoxButton.OK, MessageBoxImage.Error);}
Describe the bug
When using
NavigationService.Navigate(...)
it does not Navigate to the proper page, however it throws an error."Object reference not set to an instance of an object."
The code is as follows:
I do not know if this is the proper way, the documentation states:
Navigate(string)
Even using this does not work.
EDIT:
The error comes from a global error handler
To Reproduce
Expected behavior
The page should navigate the the proper page.
Screenshots
Main Issue Video
devenv_J9JXoCoXje.mp4
UserViewModel.cs
OS version
Windows 11
.NET version
8.0.400
WPF-UI NuGet version
3.0.4
Additional context
No response
The text was updated successfully, but these errors were encountered: