Skip to content
Open
8 changes: 8 additions & 0 deletions AIDevGallery/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
NavigatedToPageEvent.Log(nameof(HomePage));
}

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
// Remove all content to guarantee nothing can be rendered; reference issue: https://github.com/microsoft/ai-dev-gallery/pull/460
this.Content = null;

base.OnNavigatingFrom(e);
}

private void Page_Loaded(object sender, RoutedEventArgs e)
{
if (!App.AppData.IsDiagnosticsMessageDismissed && PrivacyConsentHelpers.IsPrivacySensitiveRegion())
Expand Down