Make it work - WIP

This commit is contained in:
Stefan Markovic 2021-11-06 18:03:16 +01:00
parent 79bd4031be
commit 9ad691a282
10 changed files with 65 additions and 36 deletions

View file

@ -71,9 +71,17 @@ namespace Microsoft.PowerToys.Settings.UI.Library
{ {
try try
{ {
long seconds = long.Parse(LastCheckedDate, CultureInfo.CurrentCulture); // TODO(stefan) revert this
var date = DateTimeOffset.FromUnixTimeSeconds(seconds).UtcDateTime; if (LastCheckedDate != null)
return date.ToLocalTime().ToString(CultureInfo.CurrentCulture); {
long seconds = long.Parse(LastCheckedDate, CultureInfo.CurrentCulture);
var date = DateTimeOffset.FromUnixTimeSeconds(seconds).UtcDateTime;
return date.ToLocalTime().ToString(CultureInfo.CurrentCulture);
}
else
{
return DateTime.UtcNow.ToString(CultureInfo.CurrentCulture);
}
} }
#pragma warning disable CA1031 // Do not catch general exception types #pragma warning disable CA1031 // Do not catch general exception types
catch (Exception) catch (Exception)

View file

@ -90,7 +90,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Controls
this.Unloaded += ShortcutControl_Unloaded; this.Unloaded += ShortcutControl_Unloaded;
hook = new HotkeySettingsControlHook(Hotkey_KeyDown, Hotkey_KeyUp, Hotkey_IsActive, FilterAccessibleKeyboardEvents); hook = new HotkeySettingsControlHook(Hotkey_KeyDown, Hotkey_KeyUp, Hotkey_IsActive, FilterAccessibleKeyboardEvents);
ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView(); ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse();
// We create the Dialog in C# because doing it in XAML is giving WinUI/XAML Island bugs when using dark theme. // We create the Dialog in C# because doing it in XAML is giving WinUI/XAML Island bugs when using dark theme.
shortcutDialog = new ContentDialog shortcutDialog = new ContentDialog

View file

@ -22,9 +22,9 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Converters
string targetValue = string.Empty; string targetValue = string.Empty;
switch (value) switch (value)
{ {
case 0: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Fit_Fill_ThirdPersonSingular"); break; case 0: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Fit_Fill_ThirdPersonSingular"); break;
case 1: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Fit_Fit_ThirdPersonSingular"); break; case 1: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Fit_Fit_ThirdPersonSingular"); break;
case 2: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Fit_Stretch_ThirdPersonSingular"); break; case 2: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Fit_Stretch_ThirdPersonSingular"); break;
} }
if (toLower) if (toLower)

View file

@ -22,10 +22,10 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Converters
string targetValue = string.Empty; string targetValue = string.Empty;
switch (value) switch (value)
{ {
case 0: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Centimeter"); break; case 0: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Unit_Centimeter"); break;
case 1: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Inch"); break; case 1: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Unit_Inch"); break;
case 2: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Percent"); break; case 2: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Unit_Percent"); break;
case 3: targetValue = ResourceLoader.GetForCurrentView().GetString("ImageResizer_Unit_Pixel"); break; case 3: targetValue = ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_Unit_Pixel"); break;
} }
if (toLower) if (toLower)

View file

@ -27,10 +27,5 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3
{ {
this.InitializeComponent(); this.InitializeComponent();
} }
private void myButton_Click(object sender, RoutedEventArgs e)
{
// myButton.Content = "Clicked";
}
} }
} }

View file

@ -283,10 +283,12 @@
<value>Remap a key</value> <value>Remap a key</value>
<comment>Keyboard Manager remap keyboard button content</comment> <comment>Keyboard Manager remap keyboard button content</comment>
</data> </data>
<!--
<data name="KeyboardManager_RemapKeyboardButton_Accessible.AutomationProperties.Name" xml:space="preserve"> <data name="KeyboardManager_RemapKeyboardButton_Accessible.AutomationProperties.Name" xml:space="preserve">
<value>Remap a key</value> <value>Remap a key</value>
<comment>Keyboard Manager remap keyboard button content</comment> <comment>Keyboard Manager remap keyboard button content</comment>
</data> </data>
-->
<data name="KeyboardManager_Keys.Header" xml:space="preserve"> <data name="KeyboardManager_Keys.Header" xml:space="preserve">
<value>Keys</value> <value>Keys</value>
<comment>Keyboard Manager remap keyboard header</comment> <comment>Keyboard Manager remap keyboard header</comment>
@ -295,10 +297,12 @@
<value>Remap a shortcut</value> <value>Remap a shortcut</value>
<comment>Keyboard Manager remap shortcuts button</comment> <comment>Keyboard Manager remap shortcuts button</comment>
</data> </data>
<!--
<data name="KeyboardManager_RemapShortcutsButton_Accessible.AutomationProperties.Name" xml:space="preserve"> <data name="KeyboardManager_RemapShortcutsButton_Accessible.AutomationProperties.Name" xml:space="preserve">
<value>Remap a shortcut</value> <value>Remap a shortcut</value>
<comment>Keyboard Manager remap shortcuts button</comment> <comment>Keyboard Manager remap shortcuts button</comment>
</data> </data>
-->
<data name="KeyboardManager_Shortcuts.Header" xml:space="preserve"> <data name="KeyboardManager_Shortcuts.Header" xml:space="preserve">
<value>Shortcuts</value> <value>Shortcuts</value>
<comment>Keyboard Manager remap keyboard header</comment> <comment>Keyboard Manager remap keyboard header</comment>
@ -309,12 +313,14 @@
<data name="Shortcut.Header" xml:space="preserve"> <data name="Shortcut.Header" xml:space="preserve">
<value>Shortcut</value> <value>Shortcut</value>
</data> </data>
<!--
<data name="RemapKeysList.AutomationProperties.Name" xml:space="preserve"> <data name="RemapKeysList.AutomationProperties.Name" xml:space="preserve">
<value>Current Key Remappings</value> <value>Current Key Remappings</value>
</data> </data>
<data name="RemapShortcutsList.AutomationProperties.Name" xml:space="preserve"> <data name="RemapShortcutsList.AutomationProperties.Name" xml:space="preserve">
<value>Current Shortcut Remappings</value> <value>Current Shortcut Remappings</value>
</data> </data>
-->
<data name="KeyboardManager_RemappedKeysListItem.AutomationProperties.Name" xml:space="preserve"> <data name="KeyboardManager_RemappedKeysListItem.AutomationProperties.Name" xml:space="preserve">
<value>Key Remapping</value> <value>Key Remapping</value>
<comment>key as in keyboard key</comment> <comment>key as in keyboard key</comment>
@ -478,10 +484,12 @@
<value>Launch layout editor</value> <value>Launch layout editor</value>
<comment>launches the FancyZones layout editor application</comment> <comment>launches the FancyZones layout editor application</comment>
</data> </data>
<!--
<data name="FancyZones_LaunchEditorButton_Accessible.AutomationProperties.Name" xml:space="preserve"> <data name="FancyZones_LaunchEditorButton_Accessible.AutomationProperties.Name" xml:space="preserve">
<value>Launch layout editor</value> <value>Launch layout editor</value>
<comment>launches the FancyZones layout editor application</comment> <comment>launches the FancyZones layout editor application</comment>
</data> </data>
-->
<data name="FancyZones_LaunchEditorButtonControl.Description" xml:space="preserve"> <data name="FancyZones_LaunchEditorButtonControl.Description" xml:space="preserve">
<value>Set and manage your layouts</value> <value>Set and manage your layouts</value>
<comment>launches the FancyZones layout editor application</comment> <comment>launches the FancyZones layout editor application</comment>
@ -715,9 +723,11 @@
<value>Enable Image Resizer</value> <value>Enable Image Resizer</value>
<comment>do not loc the Product name. Do you want this feature on / off</comment> <comment>do not loc the Product name. Do you want this feature on / off</comment>
</data> </data>
<!--
<data name="ImagesSizesListView.AutomationProperties.Name" xml:space="preserve"> <data name="ImagesSizesListView.AutomationProperties.Name" xml:space="preserve">
<value>Image Size</value> <value>Image Size</value>
</data> </data>
-->
<data name="ImageResizer_Configurations.AutomationProperties.Name" xml:space="preserve"> <data name="ImageResizer_Configurations.AutomationProperties.Name" xml:space="preserve">
<value>Configurations</value> <value>Configurations</value>
</data> </data>
@ -736,10 +746,12 @@
<data name="ImageResizer_Size.Header" xml:space="preserve"> <data name="ImageResizer_Size.Header" xml:space="preserve">
<value>Unit</value> <value>Unit</value>
</data> </data>
<!--
<data name="RemoveButton.AutomationProperties.Name" xml:space="preserve"> <data name="RemoveButton.AutomationProperties.Name" xml:space="preserve">
<value>Remove</value> <value>Remove</value>
<comment>Removes a user defined setting group for Image Resizer</comment> <comment>Removes a user defined setting group for Image Resizer</comment>
</data> </data>
-->
<data name="ImageResizer_Image.AutomationProperties.Name" xml:space="preserve"> <data name="ImageResizer_Image.AutomationProperties.Name" xml:space="preserve">
<value>Image Resizer</value> <value>Image Resizer</value>
</data> </data>
@ -912,9 +924,11 @@
<data name="General_VersionLastChecked.Text" xml:space="preserve"> <data name="General_VersionLastChecked.Text" xml:space="preserve">
<value>Last checked: </value> <value>Last checked: </value>
</data> </data>
<!--
<data name="General_Version.AutomationProperties.Name" xml:space="preserve"> <data name="General_Version.AutomationProperties.Name" xml:space="preserve">
<value>Version</value> <value>Version</value>
</data> </data>
-->
<data name="Admin_mode.Header" xml:space="preserve"> <data name="Admin_mode.Header" xml:space="preserve">
<value>Administrator mode</value> <value>Administrator mode</value>
</data> </data>
@ -1012,9 +1026,11 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve"> <data name="ImageResizer_FilenameFormatPlaceholder.PlaceholderText" xml:space="preserve">
<value>Example: %1 (%2)</value> <value>Example: %1 (%2)</value>
</data> </data>
<!--
<data name="ImageResizer_FilenameParameters.AutomationProperties.Name" xml:space="preserve"> <data name="ImageResizer_FilenameParameters.AutomationProperties.Name" xml:space="preserve">
<value>Filename parameters</value> <value>Filename parameters</value>
</data> </data>
-->
<data name="Radio_Theme_Dark.Content" xml:space="preserve"> <data name="Radio_Theme_Dark.Content" xml:space="preserve">
<value>Dark</value> <value>Dark</value>
<comment>Dark refers to color, not weight</comment> <comment>Dark refers to color, not weight</comment>
@ -1118,12 +1134,14 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<value>Small</value> <value>Small</value>
<comment>The size of the image</comment> <comment>The size of the image</comment>
</data> </data>
<!--
<data name="FancyZones_MoveWindowBasedOnRelativePosition_Accessible.AutomationProperties.Name" xml:space="preserve"> <data name="FancyZones_MoveWindowBasedOnRelativePosition_Accessible.AutomationProperties.Name" xml:space="preserve">
<value>Windows key + Up, down, left or right arrow key to move windows based on relative position</value> <value>Windows key + Up, down, left or right arrow key to move windows based on relative position</value>
</data> </data>
<data name="FancyZones_MoveWindowLeftRightBasedOnZoneIndex_Accessible.AutomationProperties.Name" xml:space="preserve"> <data name="FancyZones_MoveWindowLeftRightBasedOnZoneIndex_Accessible.AutomationProperties.Name" xml:space="preserve">
<value>Windows key + Left or right arrow keys to move windows based on zone index</value> <value>Windows key + Left or right arrow keys to move windows based on zone index</value>
</data> </data>
-->
<data name="FancyZones_MoveWindowBasedOnRelativePosition_Description.Text" xml:space="preserve"> <data name="FancyZones_MoveWindowBasedOnRelativePosition_Description.Text" xml:space="preserve">
<value>Windows key +    or </value> <value>Windows key +    or </value>
<comment>Do not loc the icons (hex numbers)</comment> <comment>Do not loc the icons (hex numbers)</comment>
@ -1175,9 +1193,11 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="PowerLauncher_IncludeInGlobalResultDescription.Text" xml:space="preserve"> <data name="PowerLauncher_IncludeInGlobalResultDescription.Text" xml:space="preserve">
<value>Show results on queries without direct activation command</value> <value>Show results on queries without direct activation command</value>
</data> </data>
<!--
<data name="PowerLauncher_EnablePluginToggle.AutomationProperties.Name" xml:space="preserve"> <data name="PowerLauncher_EnablePluginToggle.AutomationProperties.Name" xml:space="preserve">
<value>Enable plugin</value> <value>Enable plugin</value>
</data> </data>
-->
<data name="Run_AdditionalOptions.Text" xml:space="preserve"> <data name="Run_AdditionalOptions.Text" xml:space="preserve">
<value>Additional options</value> <value>Additional options</value>
</data> </data>
@ -1534,9 +1554,11 @@ From there, simply click on a Markdown file, PDF file or SVG icon in the File Ex
<data name="ImageResizer_Unit_Pixel" xml:space="preserve"> <data name="ImageResizer_Unit_Pixel" xml:space="preserve">
<value>Pixels</value> <value>Pixels</value>
</data> </data>
<!--
<data name="EditButton.AutomationProperties.Name" xml:space="preserve"> <data name="EditButton.AutomationProperties.Name" xml:space="preserve">
<value>Edit</value> <value>Edit</value>
</data> </data>
-->
<data name="No" xml:space="preserve"> <data name="No" xml:space="preserve">
<value>No</value> <value>No</value>
<comment>Label of a cancel button</comment> <comment>Label of a cancel button</comment>
@ -1557,12 +1579,14 @@ From there, simply click on a Markdown file, PDF file or SVG icon in the File Ex
<data name="ExcludedApps.Header" xml:space="preserve"> <data name="ExcludedApps.Header" xml:space="preserve">
<value>Excluded apps</value> <value>Excluded apps</value>
</data> </data>
<!--
<data name="Enable_ColorFormat.AutomationProperties.Name" xml:space="preserve"> <data name="Enable_ColorFormat.AutomationProperties.Name" xml:space="preserve">
<value>Enable colorformat</value> <value>Enable colorformat</value>
</data> </data>
<data name="More_Options_Button.AutomationProperties.Name" xml:space="preserve"> <data name="More_Options_Button.AutomationProperties.Name" xml:space="preserve">
<value>More options</value> <value>More options</value>
</data> </data>
-->
<data name="More_Options_ButtonTooltip.Text" xml:space="preserve"> <data name="More_Options_ButtonTooltip.Text" xml:space="preserve">
<value>More options</value> <value>More options</value>
</data> </data>
@ -1645,9 +1669,11 @@ From there, simply click on a Markdown file, PDF file or SVG icon in the File Ex
<data name="PowerLauncher_SearchList.PlaceholderText" xml:space="preserve"> <data name="PowerLauncher_SearchList.PlaceholderText" xml:space="preserve">
<value>Search this list</value> <value>Search this list</value>
</data> </data>
<!--
<data name="PowerLauncher_SearchList.AutomationProperties.Name" xml:space="preserve"> <data name="PowerLauncher_SearchList.AutomationProperties.Name" xml:space="preserve">
<value>Search this list</value> <value>Search this list</value>
</data> </data>
-->
<data name="Awake.SecondaryLinksHeader" xml:space="preserve"> <data name="Awake.SecondaryLinksHeader" xml:space="preserve">
<value>Attribution</value> <value>Attribution</value>
</data> </data>

View file

@ -23,8 +23,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
{ {
InitializeComponent(); InitializeComponent();
var settingsUtils = new SettingsUtils(); var settingsUtils = new SettingsUtils();
//TODO(stefan) var resourceLoader = ResourceLoader.GetForViewIndependentUse();
//var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
Func<string, string> loader = (string name) => Func<string, string> loader = (string name) =>
{ {
//return resourceLoader.GetString(name); //return resourceLoader.GetString(name);
@ -42,7 +41,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
if (deleteRowButton != null) if (deleteRowButton != null)
{ {
ImageSize x = (ImageSize)deleteRowButton.DataContext; ImageSize x = (ImageSize)deleteRowButton.DataContext;
ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView(); ResourceLoader resourceLoader = ResourceLoader.GetForViewIndependentUse();
ContentDialog dialog = new ContentDialog(); ContentDialog dialog = new ContentDialog();
dialog.XamlRoot = RootPage.XamlRoot; dialog.XamlRoot = RootPage.XamlRoot;
@ -73,7 +72,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
{ {
try try
{ {
ViewModel.AddRow(ResourceLoader.GetForCurrentView().GetString("ImageResizer_DefaultSize_NewSizePrefix")); ViewModel.AddRow(ResourceLoader.GetForViewIndependentUse().GetString("ImageResizer_DefaultSize_NewSizePrefix"));
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -87,8 +86,8 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
if (ViewModel.IsListViewFocusRequested) if (ViewModel.IsListViewFocusRequested)
{ {
// Set focus to the last item in the ListView // Set focus to the last item in the ListView
int size = ImagesSizesListView.Items.Count; //int size = ImagesSizesListView.Items.Count;
((ListViewItem)ImagesSizesListView.ContainerFromIndex(size - 1)).Focus(FocusState.Programmatic); //((ListViewItem)ImagesSizesListView.ContainerFromIndex(size - 1)).Focus(FocusState.Programmatic);
// Reset the focus requested flag // Reset the focus requested flag
ViewModel.IsListViewFocusRequested = false; ViewModel.IsListViewFocusRequested = false;

View file

@ -23,14 +23,15 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
{ {
private const string PowerToyName = "Keyboard Manager"; private const string PowerToyName = "Keyboard Manager";
private readonly CoreDispatcher dispatcher; // TODO(stefan) bring this back
//private readonly CoreDispatcher dispatcher;
private readonly IFileSystemWatcher watcher; private readonly IFileSystemWatcher watcher;
public KeyboardManagerViewModel ViewModel { get; } public KeyboardManagerViewModel ViewModel { get; }
public KeyboardManagerPage() public KeyboardManagerPage()
{ {
dispatcher = Window.Current.Dispatcher; //dispatcher = Window.Current.Dispatcher;
var settingsUtils = new SettingsUtils(); var settingsUtils = new SettingsUtils();
ViewModel = new KeyboardManagerViewModel(settingsUtils, SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage, FilterRemapKeysList); ViewModel = new KeyboardManagerViewModel(settingsUtils, SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), ShellPage.SendDefaultIPCMessage, FilterRemapKeysList);
@ -50,18 +51,18 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
// Todo: Handle duplicate events either by somehow suppress them or re-read the configuration everytime since we will be updating the UI only if something is changed. // Todo: Handle duplicate events either by somehow suppress them or re-read the configuration everytime since we will be updating the UI only if something is changed.
if (ViewModel.LoadProfile()) if (ViewModel.LoadProfile())
{ {
await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => /*await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{ {
ViewModel.NotifyFileChanged(); ViewModel.NotifyFileChanged();
}); });*/
} }
} }
private static void CombineRemappings(List<KeysDataModel> remapKeysList, uint leftKey, uint rightKey, uint combinedKey) private static void CombineRemappings(List<KeysDataModel> remapKeysList, uint leftKey, uint rightKey, uint combinedKey)
{ {
// Using InvariantCulture for keys as they are internally represented as numerical values // Using InvariantCulture for keys as they are internally represented as numerical values
KeysDataModel firstRemap = remapKeysList.Find(x => uint.Parse(x.OriginalKeys, CultureInfo.InvariantCulture) == leftKey); KeysDataModel firstRemap = remapKeysList?.Find(x => uint.Parse(x.OriginalKeys, CultureInfo.InvariantCulture) == leftKey);
KeysDataModel secondRemap = remapKeysList.Find(x => uint.Parse(x.OriginalKeys, CultureInfo.InvariantCulture) == rightKey); KeysDataModel secondRemap = remapKeysList?.Find(x => uint.Parse(x.OriginalKeys, CultureInfo.InvariantCulture) == rightKey);
if (firstRemap != null && secondRemap != null) if (firstRemap != null && secondRemap != null)
{ {
if (firstRemap.NewRemapKeys == secondRemap.NewRemapKeys) if (firstRemap.NewRemapKeys == secondRemap.NewRemapKeys)

View file

@ -9,6 +9,7 @@ using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Utilities; using Microsoft.PowerToys.Settings.UI.Library.Utilities;
using Microsoft.PowerToys.Settings.UI.Library.ViewModels; using Microsoft.PowerToys.Settings.UI.Library.ViewModels;
using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls;
using Windows.ApplicationModel.Resources;
// TODO(stefan) // TODO(stefan)
using WindowsUI = Windows.UI; using WindowsUI = Windows.UI;
@ -52,8 +53,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
} }
}); });
// TODO(stefan) var loader = ResourceLoader.GetForViewIndependentUse();
/* var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
searchResultPreferencesOptions = new ObservableCollection<Tuple<string, string>>(); 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_AlphabeticalOrder"), "alphabetical_order"));
@ -64,7 +64,7 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ApplicationName"), "application_name")); 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_StringInApplication"), "string_in_application"));
searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name")); searchTypePreferencesOptions.Add(Tuple.Create(loader.GetString("PowerLauncher_SearchTypePreference_ExecutableName"), "executable_name"));
*/ } }
private void OpenColorsSettings_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e) private void OpenColorsSettings_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
{ {

View file

@ -14,6 +14,7 @@ using Microsoft.UI.Xaml.Controls;
// TODO(stefan) // TODO(stefan)
using WSL = Windows.System.Launcher; using WSL = Windows.System.Launcher;
using Windows.ApplicationModel.Resources;
namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
{ {
@ -186,14 +187,13 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
if (AutomationPeer.ListenerExists(AutomationEvents.MenuOpened)) if (AutomationPeer.ListenerExists(AutomationEvents.MenuOpened))
{ {
// TODO(stefan) var loader = ResourceLoader.GetForViewIndependentUse();
/* var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
peer.RaiseNotificationEvent( peer.RaiseNotificationEvent(
AutomationNotificationKind.ActionCompleted, AutomationNotificationKind.ActionCompleted,
AutomationNotificationProcessing.ImportantMostRecent, AutomationNotificationProcessing.ImportantMostRecent,
loader.GetString("Shell_NavigationMenu_Announce_Open"), loader.GetString("Shell_NavigationMenu_Announce_Open"),
"navigationMenuPaneOpened"); "navigationMenuPaneOpened");
*/ } }
} }
[SuppressMessage("Usage", "CA1801:Review unused parameters", Justification = "Params are required for event handler signature requirements.")] [SuppressMessage("Usage", "CA1801:Review unused parameters", Justification = "Params are required for event handler signature requirements.")]
@ -214,13 +214,13 @@ namespace Microsoft.PowerToys.Settings.UI.WinUI3.Views
if (AutomationPeer.ListenerExists(AutomationEvents.MenuClosed)) if (AutomationPeer.ListenerExists(AutomationEvents.MenuClosed))
{ {
// TODO(stefan) // TODO(stefan)
/* var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView(); var loader = ResourceLoader.GetForViewIndependentUse();
peer.RaiseNotificationEvent( peer.RaiseNotificationEvent(
AutomationNotificationKind.ActionCompleted, AutomationNotificationKind.ActionCompleted,
AutomationNotificationProcessing.ImportantMostRecent, AutomationNotificationProcessing.ImportantMostRecent,
loader.GetString("Shell_NavigationMenu_Announce_Collapse"), loader.GetString("Shell_NavigationMenu_Announce_Collapse"),
"navigationMenuPaneClosed"); "navigationMenuPaneClosed");
*/} }
} }
private void OOBEItem_Tapped(object sender, Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e) private void OOBEItem_Tapped(object sender, Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e)