From f0b35f9efa81d1111075875ef6028295712999aa Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:59:40 -0500 Subject: [PATCH 1/8] move ExtensionSettings pages and viewmodel to Extension project --- .../DevHome.ExtensionLibrary.csproj | 6 +++++- .../ViewModels/ExtensionSettingsViewModel.cs | 2 +- .../Views/ExtensionSettingsPage.xaml | 2 +- .../Views/ExtensionSettingsPage.xaml.cs | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) rename {settings/DevHome.Settings => tools/ExtensionLibrary/DevHome.ExtensionLibrary}/ViewModels/ExtensionSettingsViewModel.cs (96%) rename {settings/DevHome.Settings => tools/ExtensionLibrary/DevHome.ExtensionLibrary}/Views/ExtensionSettingsPage.xaml (94%) rename {settings/DevHome.Settings => tools/ExtensionLibrary/DevHome.ExtensionLibrary}/Views/ExtensionSettingsPage.xaml.cs (85%) diff --git a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/DevHome.ExtensionLibrary.csproj b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/DevHome.ExtensionLibrary.csproj index 1e605ae57c..4d1390bf45 100644 --- a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/DevHome.ExtensionLibrary.csproj +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/DevHome.ExtensionLibrary.csproj @@ -1,5 +1,5 @@  - + DevHome.ExtensionLibrary x86;x64;arm64 @@ -10,6 +10,7 @@ + @@ -26,6 +27,9 @@ MSBuild:Compile + + $(DefaultXamlRuntime) + diff --git a/settings/DevHome.Settings/ViewModels/ExtensionSettingsViewModel.cs b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs similarity index 96% rename from settings/DevHome.Settings/ViewModels/ExtensionSettingsViewModel.cs rename to tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs index d73cabef7d..3b48550dde 100644 --- a/settings/DevHome.Settings/ViewModels/ExtensionSettingsViewModel.cs +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs @@ -15,7 +15,7 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.Windows.DevHome.SDK; -namespace DevHome.Settings.ViewModels; +namespace DevHome.ExtensionLibrary.ViewModels; public partial class ExtensionSettingsViewModel : ObservableObject { diff --git a/settings/DevHome.Settings/Views/ExtensionSettingsPage.xaml b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/Views/ExtensionSettingsPage.xaml similarity index 94% rename from settings/DevHome.Settings/Views/ExtensionSettingsPage.xaml rename to tools/ExtensionLibrary/DevHome.ExtensionLibrary/Views/ExtensionSettingsPage.xaml index a7518e689e..2058d29b62 100644 --- a/settings/DevHome.Settings/Views/ExtensionSettingsPage.xaml +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/Views/ExtensionSettingsPage.xaml @@ -2,7 +2,7 @@ Date: Thu, 22 Feb 2024 17:04:17 -0500 Subject: [PATCH 2/8] delete extensions page --- .../DevHome.Settings/DevHome.Settings.csproj | 8 -- .../ViewModels/ExtensionsViewModel.cs | 113 ------------------ .../Views/ExtensionsPage.xaml | 59 --------- .../Views/ExtensionsPage.xaml.cs | 45 ------- 4 files changed, 225 deletions(-) delete mode 100644 settings/DevHome.Settings/ViewModels/ExtensionsViewModel.cs delete mode 100644 settings/DevHome.Settings/Views/ExtensionsPage.xaml delete mode 100644 settings/DevHome.Settings/Views/ExtensionsPage.xaml.cs diff --git a/settings/DevHome.Settings/DevHome.Settings.csproj b/settings/DevHome.Settings/DevHome.Settings.csproj index 734c049ffa..8dcf030bc1 100644 --- a/settings/DevHome.Settings/DevHome.Settings.csproj +++ b/settings/DevHome.Settings/DevHome.Settings.csproj @@ -21,8 +21,6 @@ - - @@ -60,12 +58,6 @@ $(DefaultXamlRuntime) - - $(DefaultXamlRuntime) - - - $(DefaultXamlRuntime) - MSBuild:Compile diff --git a/settings/DevHome.Settings/ViewModels/ExtensionsViewModel.cs b/settings/DevHome.Settings/ViewModels/ExtensionsViewModel.cs deleted file mode 100644 index 9bbdca9d5d..0000000000 --- a/settings/DevHome.Settings/ViewModels/ExtensionsViewModel.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using CommunityToolkit.WinUI; -using DevHome.Common.Extensions; -using DevHome.Common.Services; -using DevHome.Settings.Models; -using DevHome.Settings.TelemetryEvents; -using DevHome.Telemetry; -using Microsoft.UI.Xaml; -using Windows.ApplicationModel; - -namespace DevHome.Settings.ViewModels; - -public partial class ExtensionViewModel : ObservableObject -{ - private readonly Setting _setting; - - private readonly ExtensionsViewModel _extensionsViewModel; - - public ExtensionViewModel(Setting setting, ExtensionsViewModel extensionsViewModel) - { - _setting = setting; - _extensionsViewModel = extensionsViewModel; - } - - public string Path => _setting.Path; - - public string Header => _setting.Header; - - public string Description => _setting.Description; - - public bool HasToggleSwitch => _setting.HasToggleSwitch; - - public bool HasSettingsProvider => _setting.HasSettingsProvider; - - public bool IsEnabled - { - get => _setting.IsExtensionEnabled; - set => _setting.IsExtensionEnabled = value; - } - - [RelayCommand] - private void NavigateSettings() - { - _extensionsViewModel.Navigate(_setting.Path); - } -} - -public partial class ExtensionsViewModel : ObservableObject -{ - private readonly Microsoft.UI.Dispatching.DispatcherQueue _dispatcher; - - [ObservableProperty] - private ObservableCollection _settingsList = new(); - - public ExtensionsViewModel() - { - _dispatcher = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread(); - - var extensionService = Application.Current.GetService(); - extensionService.OnExtensionsChanged -= OnExtensionsChanged; - extensionService.OnExtensionsChanged += OnExtensionsChanged; - - DisplaySettings(); - } - - private void DisplaySettings() - { - var extensionWrappers = Task.Run(async () => - { - var extensionService = Application.Current.GetService(); - return await extensionService.GetInstalledExtensionsAsync(true); - }).Result; - - extensionWrappers = extensionWrappers.OrderBy(extensionWrapper => extensionWrapper.Name); - - SettingsList.Clear(); - - foreach (var extensionWrapper in extensionWrappers) - { - // Don't show self as an extension - if (Package.Current.Id.FullName == extensionWrapper.PackageFullName) - { - continue; - } - - var hasSettingsProvider = extensionWrapper.HasProviderType(Microsoft.Windows.DevHome.SDK.ProviderType.Settings); - var setting = new Setting("Extensions/" + extensionWrapper.ExtensionUniqueId, extensionWrapper.ExtensionUniqueId, extensionWrapper.Name, string.Empty, string.Empty, true, hasSettingsProvider); - SettingsList.Add(new ExtensionViewModel(setting, this)); - } - } - - private async void OnExtensionsChanged(object? sender, EventArgs e) - { - await _dispatcher.EnqueueAsync(() => { DisplaySettings(); }); - } - - public void Navigate(string path) - { - TelemetryFactory.Get().Log("ExtensionsSettings_Navigate_Event", LogLevel.Critical, new NavigateToExtensionSettingsEvent("ExtensionsViewModel")); - - var navigationService = Application.Current.GetService(); - var segments = path.Split("/"); - navigationService.NavigateTo(typeof(ExtensionSettingsViewModel).FullName!, segments[1]); - } -} diff --git a/settings/DevHome.Settings/Views/ExtensionsPage.xaml b/settings/DevHome.Settings/Views/ExtensionsPage.xaml deleted file mode 100644 index 9519f506a7..0000000000 --- a/settings/DevHome.Settings/Views/ExtensionsPage.xaml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/settings/DevHome.Settings/Views/ExtensionsPage.xaml.cs b/settings/DevHome.Settings/Views/ExtensionsPage.xaml.cs deleted file mode 100644 index b0003d7cc5..0000000000 --- a/settings/DevHome.Settings/Views/ExtensionsPage.xaml.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System.Collections.ObjectModel; -using DevHome.Common.Services; -using DevHome.Settings.Models; -using DevHome.Settings.ViewModels; -using Microsoft.UI.Xaml.Controls; - -namespace DevHome.Settings.Views; - -public sealed partial class ExtensionsPage : Page -{ - public ExtensionsViewModel ViewModel - { - get; - } - - public ObservableCollection Breadcrumbs - { - get; - } - - public ExtensionsPage() - { - ViewModel = new ExtensionsViewModel(); - this.InitializeComponent(); - - var stringResource = new StringResource("DevHome.Settings/Resources"); - Breadcrumbs = new ObservableCollection - { - new(stringResource.GetLocalized("Settings_Header"), typeof(SettingsViewModel).FullName!), - new(stringResource.GetLocalized("Settings_Extensions_Header"), typeof(ExtensionsViewModel).FullName!), - }; - } - - private void BreadcrumbBar_ItemClicked(BreadcrumbBar sender, BreadcrumbBarItemClickedEventArgs args) - { - if (args.Index < Breadcrumbs.Count - 1) - { - var crumb = (Breadcrumb)args.Item; - crumb.NavigateTo(); - } - } -} From 7126f85c6e9e2abc7ad9428aac5e24cd4d41aab5 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:05:04 -0500 Subject: [PATCH 3/8] separate out SettingViewModel and SettingsViewModel --- .../ViewModels/SettingViewModel.cs | 37 +++++++++++++++++++ .../ViewModels/SettingsViewModel.cs | 30 --------------- 2 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 settings/DevHome.Settings/ViewModels/SettingViewModel.cs diff --git a/settings/DevHome.Settings/ViewModels/SettingViewModel.cs b/settings/DevHome.Settings/ViewModels/SettingViewModel.cs new file mode 100644 index 0000000000..1fc1a38b8f --- /dev/null +++ b/settings/DevHome.Settings/ViewModels/SettingViewModel.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using DevHome.Settings.Models; + +namespace DevHome.Settings.ViewModels; + +public partial class SettingViewModel : ObservableObject +{ + private readonly Setting _setting; + + private readonly SettingsViewModel _settingsViewModel; + + public SettingViewModel(Setting setting, SettingsViewModel settingsViewModel) + { + _setting = setting; + _settingsViewModel = settingsViewModel; + } + + public string Path => _setting.Path; + + public string Header => _setting.Header; + + public string Description => _setting.Description; + + public string Glyph => _setting.Glyph; + + public bool HasToggleSwitch => _setting.HasToggleSwitch; + + [RelayCommand] + private void NavigateSettings() + { + _settingsViewModel.Navigate(_setting.Path); + } +} diff --git a/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs b/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs index 974800051a..f4b4e64fbf 100644 --- a/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs +++ b/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs @@ -3,7 +3,6 @@ using System.Collections.ObjectModel; using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; using DevHome.Common.Extensions; using DevHome.Common.Services; using DevHome.Settings.Models; @@ -11,35 +10,6 @@ namespace DevHome.Settings.ViewModels; -public partial class SettingViewModel : ObservableObject -{ - private readonly Setting _setting; - - private readonly SettingsViewModel _settingsViewModel; - - public SettingViewModel(Setting setting, SettingsViewModel settingsViewModel) - { - _setting = setting; - _settingsViewModel = settingsViewModel; - } - - public string Path => _setting.Path; - - public string Header => _setting.Header; - - public string Description => _setting.Description; - - public string Glyph => _setting.Glyph; - - public bool HasToggleSwitch => _setting.HasToggleSwitch; - - [RelayCommand] - private void NavigateSettings() - { - _settingsViewModel.Navigate(_setting.Path); - } -} - public partial class SettingsViewModel : ObservableObject { [ObservableProperty] From dd752c1ac447a13a2d9e1c52aeab6b7ced6ab4b0 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:05:40 -0500 Subject: [PATCH 4/8] remove extensions page from SettingsViewModel --- settings/DevHome.Settings/ViewModels/SettingsViewModel.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs b/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs index f4b4e64fbf..d3f1657193 100644 --- a/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs +++ b/settings/DevHome.Settings/ViewModels/SettingsViewModel.cs @@ -23,7 +23,6 @@ public SettingsViewModel() { new Setting("Preferences", string.Empty, stringResource.GetLocalized("Settings_Preferences_Header"), stringResource.GetLocalized("Settings_Preferences_Description"), "\ue713", false, false), new Setting("Accounts", string.Empty, stringResource.GetLocalized("Settings_Accounts_Header"), stringResource.GetLocalized("Settings_Accounts_Description"), "\ue77b", false, false), - new Setting("Extensions", string.Empty, stringResource.GetLocalized("Settings_Extensions_Header"), stringResource.GetLocalized("Settings_Extensions_Description"), "\ued35", false, false), new Setting("ExperimentalFeatures", string.Empty, stringResource.GetLocalized("Settings_ExperimentalFeatures_Header"), stringResource.GetLocalized("Settings_ExperimentalFeatures_Description"), "\ue74c", false, false), new Setting("Feedback", string.Empty, stringResource.GetLocalized("Settings_Feedback_Header"), stringResource.GetLocalized("Settings_Feedback_Description"), "\ued15", false, false), new Setting("About", string.Empty, stringResource.GetLocalized("Settings_About_Header"), stringResource.GetLocalized("Settings_About_Description"), "\ue946", false, false), @@ -47,9 +46,6 @@ public void Navigate(string path) case "Accounts": navigationService.NavigateTo(typeof(AccountsViewModel).FullName!); return; - case "Extensions": - navigationService.NavigateTo(typeof(ExtensionsViewModel).FullName!); - return; case "About": navigationService.NavigateTo(typeof(AboutViewModel).FullName!); return; From a684c5e5d0c05e71927f220a46358e68f50aa0d0 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:45:12 -0500 Subject: [PATCH 5/8] reflect moves and removes --- settings/DevHome.Settings/Extensions/ServiceExtensions.cs | 4 ---- src/Services/PageService.cs | 5 ++--- .../DevHome.ExtensionLibrary/Extensions/ServiceExtensions.cs | 5 ++++- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/settings/DevHome.Settings/Extensions/ServiceExtensions.cs b/settings/DevHome.Settings/Extensions/ServiceExtensions.cs index b44e55cd19..7042195314 100644 --- a/settings/DevHome.Settings/Extensions/ServiceExtensions.cs +++ b/settings/DevHome.Settings/Extensions/ServiceExtensions.cs @@ -21,12 +21,8 @@ public static IServiceCollection AddSettings(this IServiceCollection services, H services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); services.AddTransient(); services.AddTransient(); - services.AddTransient(); - services.AddTransient(); services.AddSingleton(); return services; diff --git a/src/Services/PageService.cs b/src/Services/PageService.cs index 50bf88262e..bcdccabf38 100644 --- a/src/Services/PageService.cs +++ b/src/Services/PageService.cs @@ -3,15 +3,15 @@ using CommunityToolkit.Mvvm.ComponentModel; using DevHome.Common.Contracts; -using DevHome.Common.Extensions; using DevHome.Common.Models; using DevHome.Common.Services; using DevHome.Contracts.Services; +using DevHome.ExtensionLibrary.ViewModels; +using DevHome.ExtensionLibrary.Views; using DevHome.Settings.ViewModels; using DevHome.Settings.Views; using DevHome.ViewModels; using DevHome.Views; -using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; namespace DevHome.Services; @@ -33,7 +33,6 @@ public PageService(ILocalSettingsService localSettingsService, IExperimentationS Configure(); Configure(); Configure(); - Configure(); Configure(); Configure(); Configure(); diff --git a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/Extensions/ServiceExtensions.cs b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/Extensions/ServiceExtensions.cs index 312f296358..7338394c05 100644 --- a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/Extensions/ServiceExtensions.cs +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/Extensions/ServiceExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using DevHome.ExtensionLibrary.ViewModels; +using DevHome.ExtensionLibrary.Views; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -11,10 +12,12 @@ public static class ServiceExtensions { public static IServiceCollection AddExtensionLibrary(this IServiceCollection services, HostBuilderContext context) { - // View-models services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + return services; } } From 2b15bc35eece42af31aa00a35faee6ffcf589644 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:46:12 -0500 Subject: [PATCH 6/8] remove special treatment from being able to navigate to extension settings two ways --- src/ViewModels/ShellViewModel.cs | 18 +---------- .../ViewModels/ExtensionSettingsViewModel.cs | 31 +++---------------- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/src/ViewModels/ShellViewModel.cs b/src/ViewModels/ShellViewModel.cs index 6c7943dc43..96fcdd95f3 100644 --- a/src/ViewModels/ShellViewModel.cs +++ b/src/ViewModels/ShellViewModel.cs @@ -66,13 +66,7 @@ public async Task OnLoaded() private void OnNavigated(object sender, NavigationEventArgs e) { - if (IsExtensionSettingsPage(e.SourcePageType.FullName)) - { - // If we navigate to the L3 settings page for an extension, leave the selected NavigationView item as it - // was, since we might be coming from Settings or Extensions. - return; - } - else if (IsSettingsPage(e.SourcePageType.FullName)) + if (IsSettingsPage(e.SourcePageType.FullName)) { Selected = NavigationViewService.SettingsItem; return; @@ -85,16 +79,6 @@ private void OnNavigated(object sender, NavigationEventArgs e) } } - private bool IsExtensionSettingsPage(string? pageType) - { - if (string.IsNullOrEmpty(pageType)) - { - return false; - } - - return pageType.StartsWith("DevHome.Settings.Views.ExtensionSettingsPage", StringComparison.Ordinal); - } - private bool IsSettingsPage(string? pageType) { if (string.IsNullOrEmpty(pageType)) diff --git a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs index 3b48550dde..98064f92ea 100644 --- a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/ExtensionSettingsViewModel.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System.Collections.ObjectModel; -using System.Linq; using System.Threading.Tasks; using AdaptiveCards.Rendering.WinUI3; using CommunityToolkit.Mvvm.ComponentModel; @@ -11,7 +10,6 @@ using DevHome.Common.Views; using DevHome.Logging; using DevHome.Settings.Models; -using DevHome.Settings.Views; using Microsoft.UI.Xaml.Controls; using Microsoft.Windows.DevHome.SDK; @@ -22,17 +20,14 @@ public partial class ExtensionSettingsViewModel : ObservableObject private readonly IExtensionService _extensionService; private readonly INavigationService _navigationService; + public ObservableCollection Breadcrumbs { get; } + public ExtensionSettingsViewModel(IExtensionService extensionService, INavigationService navigationService) { _extensionService = extensionService; _navigationService = navigationService; - Breadcrumbs = new ObservableCollection { }; - } - - public ObservableCollection Breadcrumbs - { - get; set; + Breadcrumbs = new ObservableCollection(); } [RelayCommand] @@ -73,25 +68,7 @@ private async Task OnSettingsContentLoadedAsync(ExtensionAdaptiveCardPanel exten public void FillBreadcrumbBar(string lastCrumbName) { var stringResource = new StringResource("DevHome.Settings/Resources"); - var navigationHistory = _navigationService.Frame?.BackStack; - var lastPageType = navigationHistory?.Last().SourcePageType; - - if (lastPageType == typeof(ExtensionsPage)) - { - // If the last page we came from was Settings > Extensions, add those crumbs. - Breadcrumbs.Add(new Breadcrumb(stringResource.GetLocalized("Settings_Header"), typeof(SettingsViewModel).FullName!)); - Breadcrumbs.Add(new Breadcrumb(stringResource.GetLocalized("Settings_Extensions_Header"), typeof(ExtensionsViewModel).FullName!)); - } - else - { - // If the last page we came from was the Extension page, add that crumb. - // The ViewModel name is referenced as a string because using the type directly would create a circular - // reference between Settings and ExtensionLibrary projects. - Breadcrumbs.Add(new Breadcrumb( - stringResource.GetLocalized("Settings_Extensions_Header"), - "DevHome.ExtensionLibrary.ViewModels.ExtensionLibraryViewModel")); - } - + Breadcrumbs.Add(new(stringResource.GetLocalized("Settings_Extensions_Header"), typeof(ExtensionLibraryViewModel).FullName!)); Breadcrumbs.Add(new Breadcrumb(lastCrumbName, typeof(ExtensionSettingsViewModel).FullName!)); } From 30a5af2d9fea9198aa855392d1eb44211716ad63 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:47:08 -0500 Subject: [PATCH 7/8] misc cleanup --- settings/DevHome.Settings/Views/FeedbackPage.xaml.cs | 2 +- .../ViewModels/InstalledPackageViewModel.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/settings/DevHome.Settings/Views/FeedbackPage.xaml.cs b/settings/DevHome.Settings/Views/FeedbackPage.xaml.cs index d5243f2e47..4a2d857909 100644 --- a/settings/DevHome.Settings/Views/FeedbackPage.xaml.cs +++ b/settings/DevHome.Settings/Views/FeedbackPage.xaml.cs @@ -50,7 +50,7 @@ public FeedbackPage() Breadcrumbs = new ObservableCollection { new(stringResource.GetLocalized("Settings_Header"), typeof(SettingsViewModel).FullName!), - new(stringResource.GetLocalized("Settings_Feedback_Header"), typeof(ExtensionsViewModel).FullName!), + new(stringResource.GetLocalized("Settings_Feedback_Header"), typeof(FeedbackViewModel).FullName!), }; } diff --git a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs index 44eb578820..abe345f449 100644 --- a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs @@ -10,7 +10,6 @@ using DevHome.Common.Extensions; using DevHome.Common.Services; using DevHome.Settings.TelemetryEvents; -using DevHome.Settings.ViewModels; using DevHome.Telemetry; using Microsoft.UI.Xaml; using Windows.ApplicationModel; From 3ad586d5448120f1fa899e99d768e9b046999772 Mon Sep 17 00:00:00 2001 From: Kristen Schau <47155823+krschau@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:51:46 -0500 Subject: [PATCH 8/8] delete navigation telemetry event --- .../NavigateToExtensionSettingsEvent.cs | 31 ------------------- .../ViewModels/InstalledPackageViewModel.cs | 3 -- 2 files changed, 34 deletions(-) delete mode 100644 settings/DevHome.Settings/TelemetryEvents/NavigateToExtensionSettingsEvent.cs diff --git a/settings/DevHome.Settings/TelemetryEvents/NavigateToExtensionSettingsEvent.cs b/settings/DevHome.Settings/TelemetryEvents/NavigateToExtensionSettingsEvent.cs deleted file mode 100644 index b892ec8ea1..0000000000 --- a/settings/DevHome.Settings/TelemetryEvents/NavigateToExtensionSettingsEvent.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -using System; -using System.Diagnostics.Tracing; -using DevHome.Telemetry; -using Microsoft.Diagnostics.Telemetry; -using Microsoft.Diagnostics.Telemetry.Internal; - -namespace DevHome.Settings.TelemetryEvents; - -[EventData] -public class NavigateToExtensionSettingsEvent : EventBase -{ - public string StartingPage - { - get; - } - - public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServiceUsage; - - public NavigateToExtensionSettingsEvent(string startingPage) - { - StartingPage = startingPage; - } - - public override void ReplaceSensitiveStrings(Func replaceSensitiveStrings) - { - // No sensitive strings to replace. - } -} diff --git a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs index abe345f449..e0637370f6 100644 --- a/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs +++ b/tools/ExtensionLibrary/DevHome.ExtensionLibrary/ViewModels/InstalledPackageViewModel.cs @@ -9,7 +9,6 @@ using DevHome.Common.Contracts; using DevHome.Common.Extensions; using DevHome.Common.Services; -using DevHome.Settings.TelemetryEvents; using DevHome.Telemetry; using Microsoft.UI.Xaml; using Windows.ApplicationModel; @@ -81,8 +80,6 @@ private bool GetIsExtensionEnabled() [RelayCommand] private void NavigateSettings() { - TelemetryFactory.Get().Log("ExtensionsSettings_Navigate_Event", LogLevel.Critical, new NavigateToExtensionSettingsEvent("InstalledExtensionViewModel")); - var navigationService = Application.Current.GetService(); navigationService.NavigateTo(typeof(ExtensionSettingsViewModel).FullName!, ExtensionUniqueId); }