mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
common: refactor common library pt2 (#8588)
- remove common lib - split settings, remove common-md - move ipc interop/kb_layout to interop - rename core -> settings, settings -> old_settings - os-detect header-only; interop -> PowerToysInterop - split notifications, move single-use headers where they're used - winstore lib - rename com utils - rename Updating and Telemetry projects - rename core -> settings-ui and remove examples folder - rename settings-ui folder + consisent common/version include
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.ViewModels;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.PowerToys.Settings.UI.Views
|
||||
{
|
||||
public sealed partial class PowerLauncherPage : Page
|
||||
{
|
||||
public PowerLauncherViewModel ViewModel { get; set; }
|
||||
|
||||
private readonly ObservableCollection<Tuple<string, string>> searchResultPreferencesOptions;
|
||||
private readonly ObservableCollection<Tuple<string, string>> searchTypePreferencesOptions;
|
||||
|
||||
public PowerLauncherPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
var settingsUtils = new SettingsUtils();
|
||||
ViewModel = new PowerLauncherViewModel(settingsUtils, SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage, (int)Windows.System.VirtualKey.Space);
|
||||
DataContext = ViewModel;
|
||||
|
||||
var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
|
||||
|
||||
searchResultPreferencesOptions = new ObservableCollection<Tuple<string, string>>();
|
||||
searchResultPreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchResultPreference_AlphabeticalOrder"), "alphabetical_order"));
|
||||
searchResultPreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchResultPreference_MostRecentlyUsed"), "most_recently_used"));
|
||||
searchResultPreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchResultPreference_RunningProcessesOpenApplications"), "running_processes_open_applications"));
|
||||
|
||||
searchTypePreferencesOptions = new ObservableCollection<Tuple<string, string>>();
|
||||
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ApplicationName"), "application_name"));
|
||||
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_StringInApplication"), "string_in_application"));
|
||||
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name"));
|
||||
}
|
||||
|
||||
/*
|
||||
public Tuple<string, string> SelectedSearchResultPreference
|
||||
{
|
||||
get
|
||||
{
|
||||
return searchResultPreferencesOptions.First(item => item.Item2 == ViewModel.SearchResultPreference);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (ViewModel.SearchResultPreference != value.Item2)
|
||||
{
|
||||
ViewModel.SearchResultPreference = value.Item2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Tuple<string, string> SelectedSearchTypePreference
|
||||
{
|
||||
get
|
||||
{
|
||||
return searchTypePreferencesOptions.First(item => item.Item2 == ViewModel.SearchTypePreference);
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (ViewModel.SearchTypePreference != value.Item2)
|
||||
{
|
||||
ViewModel.SearchTypePreference = value.Item2;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user