diff --git a/AIDevGallery/Pages/HomePage.xaml b/AIDevGallery/Pages/HomePage.xaml
index 1cb99587..34e1286b 100644
--- a/AIDevGallery/Pages/HomePage.xaml
+++ b/AIDevGallery/Pages/HomePage.xaml
@@ -17,6 +17,7 @@
xmlns:ui="using:CommunityToolkit.WinUI"
xmlns:utils="using:AIDevGallery.Utils"
xmlns:wuc="using:WinUICommunity"
+ Loaded="Page_Loaded"
mc:Ignorable="d">
@@ -43,5 +44,25 @@
+
+
+
+
+
+
diff --git a/AIDevGallery/Pages/HomePage.xaml.cs b/AIDevGallery/Pages/HomePage.xaml.cs
index 017f1b0f..417960b4 100644
--- a/AIDevGallery/Pages/HomePage.xaml.cs
+++ b/AIDevGallery/Pages/HomePage.xaml.cs
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
+using AIDevGallery.Telemetry;
using AIDevGallery.Telemetry.Events;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
@@ -19,4 +20,30 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
base.OnNavigatedTo(e);
NavigatedToPageEvent.Log(nameof(HomePage));
}
+
+ private void Page_Loaded(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
+ {
+ if (!App.AppData.IsDiagnosticsMessageDismissed && PrivacyConsentHelpers.IsPrivacySensitiveRegion())
+ {
+ DiagnosticsInfoBar.IsOpen = true;
+ }
+ }
+
+ private void DiagnosticsYesButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
+ {
+ HandleDiagnosticsSetting(true);
+ }
+
+ private void DiagnosticsNoButton_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
+ {
+ HandleDiagnosticsSetting(false);
+ }
+
+ private async void HandleDiagnosticsSetting(bool isEnabled)
+ {
+ DiagnosticsInfoBar.IsOpen = false;
+ App.AppData.IsDiagnosticsMessageDismissed = true;
+ App.AppData.IsDiagnosticDataEnabled = isEnabled;
+ await App.AppData.SaveAsync();
+ }
}
\ No newline at end of file
diff --git a/AIDevGallery/Pages/SettingsPage.xaml b/AIDevGallery/Pages/SettingsPage.xaml
index 3720eceb..871a26de 100644
--- a/AIDevGallery/Pages/SettingsPage.xaml
+++ b/AIDevGallery/Pages/SettingsPage.xaml
@@ -105,19 +105,15 @@
-
+