Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "Extensions" page from Settings #2301

Merged
merged 8 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions settings/DevHome.Settings/DevHome.Settings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
<None Remove="Views\AboutPage.xaml" />
<None Remove="Views\AccountsPage.xaml" />
<None Remove="Views\ExperimentalFeaturesPage.xaml" />
<None Remove="Views\ExtensionSettingsPage.xaml" />
<None Remove="Views\ExtensionsPage.xaml" />
<None Remove="Views\FeedbackPage.xaml" />
<None Remove="Views\LoginUIDialog.xaml" />
<None Remove="Views\PreferencesPage.xaml" />
Expand Down Expand Up @@ -60,12 +58,6 @@
<Page Update="Views\PreferencesPage.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="Views\ExtensionsPage.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="Views\ExtensionSettingsPage.xaml">
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
</Page>
<Page Update="Views\ExperimentalFeaturesPage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
4 changes: 0 additions & 4 deletions settings/DevHome.Settings/Extensions/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ public static IServiceCollection AddSettings(this IServiceCollection services, H
services.AddTransient<AboutPage>();
services.AddTransient<AccountsViewModel>();
services.AddTransient<AccountsPage>();
services.AddTransient<ExtensionsViewModel>();
services.AddTransient<ExtensionsPage>();
services.AddTransient<PreferencesViewModel>();
services.AddTransient<PreferencesPage>();
services.AddTransient<ExtensionSettingsViewModel>();
services.AddTransient<ExtensionSettingsPage>();
services.AddSingleton<ExperimentalFeaturesViewModel>();

return services;
Expand Down

This file was deleted.

113 changes: 0 additions & 113 deletions settings/DevHome.Settings/ViewModels/ExtensionsViewModel.cs

This file was deleted.

37 changes: 37 additions & 0 deletions settings/DevHome.Settings/ViewModels/SettingViewModel.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
34 changes: 0 additions & 34 deletions settings/DevHome.Settings/ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,13 @@

using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DevHome.Common.Extensions;
using DevHome.Common.Services;
using DevHome.Settings.Models;
using Microsoft.UI.Xaml;

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]
Expand All @@ -53,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),
Expand All @@ -77,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;
Expand Down
59 changes: 0 additions & 59 deletions settings/DevHome.Settings/Views/ExtensionsPage.xaml

This file was deleted.

45 changes: 0 additions & 45 deletions settings/DevHome.Settings/Views/ExtensionsPage.xaml.cs

This file was deleted.

2 changes: 1 addition & 1 deletion settings/DevHome.Settings/Views/FeedbackPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public FeedbackPage()
Breadcrumbs = new ObservableCollection<Breadcrumb>
{
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!),
};
}

Expand Down
Loading
Loading