Share via

Why does SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility cause

Hong 1,526 Reputation points
2023-11-19T23:44:24.86+00:00

SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;

The above code worked fine for a UWP app. After I migrated the app to WinUI, it throws:

System.AccessViolationException
  HResult=0x80004003
  Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>


Could anyone shed some light on this?

Developer technologies | Universal Windows Platform (UWP)
Windows development | Windows App SDK
0 comments No comments

Answer accepted by question author

Junjie Zhu - MSFT 21,746 Reputation points
2023-11-20T07:48:12.9933333+00:00

Hi @Hong ,

Welcome to Microsoft Q&A!

The class Windows.UI.Core.SystemNavigationManager is not support in WinUI3 project.

It is recommended that you use Microsoft.UI.Xaml.Controls.NavigationView in your WinUI3 project.

Thank you.


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.