diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs index 32668439a54b..7336a40703f4 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Helpers/RuntimeHelper.cs @@ -17,13 +17,13 @@ public static bool IsMSIX // TODO! for whatever reason, when I ported this into the PT // codebase, this no longer compiled. We're only ever using it for // the hacked up settings and ignoring it anyways, so I'm leaving - // it commented out for now. - // + // it commented out for now. + // // See also: // * https://github.com/microsoft/win32metadata/commit/6fee67ba73bfe1b126ce524f7de8d367f0317715 // * https://github.com/microsoft/win32metadata/issues/1311 - //uint length = 0; - //return PInvoke.GetCurrentPackageFullName(ref length, null) != WIN32_ERROR.APPMODEL_ERROR_NO_PACKAGE; + // uint length = 0; + // return PInvoke.GetCurrentPackageFullName(ref length, null) != WIN32_ERROR.APPMODEL_ERROR_NO_PACKAGE; #pragma warning disable IDE0025 // Use expression body for property return true; #pragma warning restore IDE0025 // Use expression body for property diff --git a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs index f58ad922745a..8da3f8f2f030 100644 --- a/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs +++ b/src/modules/cmdpal/src/Microsoft.CmdPal.Common/Services/LocalSettingsService.cs @@ -35,7 +35,7 @@ public class LocalSettingsService : ILocalSettingsService public LocalSettingsService(IFileService fileService, IOptions options) { - _isMsix = false;// RuntimeHelper.IsMSIX; + _isMsix = false; // RuntimeHelper.IsMSIX; _fileService = fileService; _options = options.Value; @@ -91,8 +91,10 @@ public async Task HasSettingAsync(string key) if (_settings != null && _settings.TryGetValue(key, out var obj)) { var s = obj.ToString(); - if (s !=null) + if (s != null) + { return await Json.ToObjectAsync(s); + } } } diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/App.xaml.cs b/src/modules/cmdpal/src/WindowsCommandPalette/App.xaml.cs index d058e37f5520..77873a0bcbed 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/App.xaml.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/App.xaml.cs @@ -82,11 +82,11 @@ public App() //// Main window: Allow access to the main window //// from anywhere in the application. - //services.AddSingleton(_ => MainWindow); + // services.AddSingleton(_ => MainWindow); //// DispatcherQueue: Allow access to the DispatcherQueue for //// the main window for general purpose UI thread access. - //services.AddSingleton(_ => MainWindow.DispatcherQueue); + // services.AddSingleton(_ => MainWindow.DispatcherQueue); // Configuration services.Configure(context.Configuration.GetSection(nameof(LocalSettingsOptions))); diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/BookmarkActions.cs b/src/modules/cmdpal/src/WindowsCommandPalette/BookmarkActions.cs index 9b45a291e131..fcb4f800802e 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/BookmarkActions.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/BookmarkActions.cs @@ -144,8 +144,6 @@ public override ActionResult SubmitForm(string payload) bookmarkType = "web"; } - - // Construct a new json blob with the name and url var json = ""; @@ -161,9 +159,13 @@ public override ActionResult SubmitForm(string payload) var newItem = new JsonObject(); newItem["name"] = formName; newItem["bookmark"] = formBookmark; - var formData = new BookmarkData() { name = formName.ToString(), bookmark=formBookmark.ToString(), type = bookmarkType }; + var formData = new BookmarkData() + { + name = formName.ToString(), + bookmark = formBookmark.ToString(), + type = bookmarkType, + }; items.Add(JsonSerializer.SerializeToNode(formData, typeof(BookmarkData), SourceGenerationContext.Default)); - //items.Add(newItem); json = jsonState?.ToString(); } } @@ -490,21 +492,19 @@ public IListItem[] TopLevelCommands() new CommandContextItem(new OpenInTerminalAction(urlAction.Url)) ]; } - //listItem.Subtitle = "Bookmark"; + + // listItem.Subtitle = "Bookmark"; if (action is AddBookmarkPage) { } else { listItem.Tags = [ - new Tag() { + new Tag() + { Text = "Bookmark", - //Icon = new("🔗"), - //Color=Windows.UI.Color.FromArgb(255, 255, 0, 255) + + // Icon = new("🔗"), + // Color=Windows.UI.Color.FromArgb(255, 255, 0, 255) }, - //new Tag() { - // Text = "A test", - // //Icon = new("🔗"), - // Color=Windows.UI.Color.FromArgb(255, 255, 0, 0) - //} ]; } diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/FormPage.xaml.cs b/src/modules/cmdpal/src/WindowsCommandPalette/FormPage.xaml.cs index e8ebb05564d7..1237cdb2d281 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/FormPage.xaml.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/FormPage.xaml.cs @@ -35,7 +35,7 @@ public FormViewModel(IForm form) internal void InitialRender() { - //var t = new Task(() => { + // var t = new Task(() => { this.TemplateJson = this.form.TemplateJson(); try { @@ -45,11 +45,11 @@ internal void InitialRender() { this.DataJson = "{}"; } - //return true; - //}); - //t.Start(); - //await t; + // return true; + // }); + // t.Start(); + // await t; AdaptiveCardTemplate template = new(TemplateJson); var cardJson = template.Expand(DataJson); this.card = AdaptiveCard.FromJsonString(cardJson); @@ -138,7 +138,7 @@ public FormPage() // yep it's this dumb var foreground = settings.GetColorValue(UIColorType.Foreground); var lightTheme = foreground.R < 128; - Renderer.HostConfig = AdaptiveHostConfig.FromJsonString(lightTheme? LightHostConfig : DarkHostConfig).HostConfig; + Renderer.HostConfig = AdaptiveHostConfig.FromJsonString(lightTheme ? LightHostConfig : DarkHostConfig).HostConfig; } diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/ListItemViewModel.cs b/src/modules/cmdpal/src/WindowsCommandPalette/ListItemViewModel.cs index bc00b429ebe8..2b03ba54e636 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/ListItemViewModel.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/ListItemViewModel.cs @@ -11,25 +11,35 @@ namespace DeveloperCommandPalette; public sealed class ListItemViewModel : INotifyPropertyChanged, IDisposable { private readonly DispatcherQueue DispatcherQueue; + internal IListItem ListItem { get; init; } + internal string Title { get; private set; } + internal string Subtitle { get; private set; } + internal string Icon { get; private set; } internal Lazy _Details; + internal DetailsViewModel? Details => _Details.Value; + internal IFallbackHandler? FallbackHandler => this.ListItem.FallbackHandler; public event PropertyChangedEventHandler? PropertyChanged; internal ICommand DefaultAction => ListItem.Command; + internal bool CanInvoke => DefaultAction != null && DefaultAction is IInvokableCommand or IPage; + internal IconElement IcoElement => Microsoft.Terminal.UI.IconPathConverter.IconMUX(Icon); - private IEnumerable contextActions => ListItem.MoreCommands == null ? [] : ListItem.MoreCommands.Where(i => i is ICommandContextItem).Select(i=> (ICommandContextItem)i); + private IEnumerable contextActions => ListItem.MoreCommands == null ? [] : ListItem.MoreCommands.Where(i => i is ICommandContextItem).Select(i => (ICommandContextItem)i); + internal bool HasMoreCommands => contextActions.Any(); internal TagViewModel[] Tags = []; + internal bool HasTags => Tags.Length > 0; internal IList ContextActions diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/ListPage.xaml.cs b/src/modules/cmdpal/src/WindowsCommandPalette/ListPage.xaml.cs index 9f67c2757b33..5b51d357c290 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/ListPage.xaml.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/ListPage.xaml.cs @@ -42,6 +42,7 @@ public SectionInfoList(ISection? section, IEnumerable items) observable.CollectionChanged -= Items_CollectionChanged; observable.CollectionChanged += Items_CollectionChanged; } + if (this.DispatcherQueue == null) { throw new InvalidOperationException("DispatcherQueue is null"); @@ -50,7 +51,7 @@ public SectionInfoList(ISection? section, IEnumerable items) private void Items_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { - //DispatcherQueue.TryEnqueue(() => { + // DispatcherQueue.TryEnqueue(() => { if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems != null) { foreach (var i in e.NewItems) @@ -63,26 +64,29 @@ private void Items_CollectionChanged(object? sender, NotifyCollectionChangedEven this.Add(vm); } - //if (isDynamic) - //{ + + // if (isDynamic) + // { // // Dynamic lists are in charge of their own // // filtering. They know if this thing was already // // filtered or not. // FilteredItems.Add(vm); - //} + // } } } } else if (e.Action == NotifyCollectionChangedAction.Reset) { this.Clear(); - //Items.Clear(); - //if (isDynamic) - //{ + + // Items.Clear(); + // if (isDynamic) + // { // FilteredItems.Clear(); - //} + // } } - //}); + + // }); } } @@ -145,9 +149,8 @@ internal async Task UpdateListItems() // we already have, then rebuilding it. We shouldn't do that. We should // still use the results from GetItems and put them into the code in // UpdateFilter to intelligently add/remove as needed. - //Items.Clear(); - //FilteredItems.Clear(); - + // Items.Clear(); + // FilteredItems.Clear(); Collection newItems = new(); var size = sections.Length; @@ -157,19 +160,20 @@ internal async Task UpdateListItems() var sectionItems = new SectionInfoList( section, section.Items - .Where(i=>i!= null && !string.IsNullOrEmpty(i.Title)) + .Where(i => i != null && !string.IsNullOrEmpty(i.Title)) .Select(i => new ListItemViewModel(i)) ); + // var items = section.Items; // for (var i = 0; i < items.Length; i++) { // ListItemViewModel vm = new(items[i]); // Items.Add(vm); // FilteredItems.Add(vm); // } - newItems.Add(sectionItems); - //Items.Add(sectionItems); - //FilteredItems.Add(sectionItems); + + // Items.Add(sectionItems); + // FilteredItems.Add(sectionItems); } ListHelpers.InPlaceUpdateList(Items, newItems); @@ -197,7 +201,7 @@ internal async Task> GetFilteredItems(string query) } //// TODO! Probably bad that this turns list view models into listitems back to NEW view models - //return ListHelpers.FilterList(Items.Select(vm => vm.ListItem), Query).Select(li => new ListItemViewModel(li)).ToList(); + // return ListHelpers.FilterList(Items.Select(vm => vm.ListItem), Query).Select(li => new ListItemViewModel(li)).ToList(); var allFilteredItems = ListHelpers.FilterList(Items.SelectMany(section => section).Select(vm => vm.ListItem), Query).Select(li => new ListItemViewModel(li)); var newSection = new SectionInfoList(null, allFilteredItems); return [newSection]; @@ -306,9 +310,9 @@ private void ListItem_Tapped(object sender, TappedRoutedEventArgs e) if (sender is not ListViewItem listItem) return; if (listItem.DataContext is not ListItemViewModel li) return; _ = li; - // For a bit I had double-clicks Invoke and single just select, but that crashes? - //ItemsList.SelectedItem = listItem; + // For a bit I had double-clicks Invoke and single just select, but that crashes? + // ItemsList.SelectedItem = listItem; if (li.DefaultAction != null) { DoAction(new(li.DefaultAction)); @@ -317,12 +321,12 @@ private void ListItem_Tapped(object sender, TappedRoutedEventArgs e) private void ListViewItem_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e) { - //if (sender is not ListViewItem listItem) return; - //if (listItem.DataContext is not ListItemViewModel li) return; - //if (li.DefaultAction != null) - //{ + // if (sender is not ListViewItem listItem) return; + // if (listItem.DataContext is not ListItemViewModel li) return; + // if (li.DefaultAction != null) + // { // DoAction(new(li.DefaultAction)); - //} + // } } private void ItemsList_SelectionChanged(object sender, SelectionChangedEventArgs e) @@ -431,9 +435,11 @@ private async Task UpdateFilter(string text) // into us initially. We handle the filtering of these ones. Commands // from async querying happens later. var newMatches = await ViewModel.GetFilteredItems(text); + // this.ItemsCVS.Source = ViewModel.FilteredItems; // Returns back on the UI thread ListHelpers.InPlaceUpdateList(ViewModel.FilteredItems, newMatches); + // for (var i = 0; i < ViewModel.FilteredItems.Count && i < newMatches.Count; i++) // { // for (var j = i; j < ViewModel.FilteredItems.Count; j++) @@ -448,7 +454,7 @@ private async Task UpdateFilter(string text) // } // } - // if (ViewModel.FilteredItems[i] != newMatches[i]) + // if (ViewModel.FilteredItems[i] != newMatches[i]) // { // ViewModel.FilteredItems.Insert(i, newMatches[i]); // } diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/MainListItem.cs b/src/modules/cmdpal/src/WindowsCommandPalette/MainListItem.cs index f9fa490d24be..aacc059d2c8c 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/MainListItem.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/MainListItem.cs @@ -4,15 +4,15 @@ using Microsoft.Windows.CommandPalette.Extensions.Helpers; using Microsoft.Windows.CommandPalette.Extensions; using Windows.Foundation; -//using Quicklinks; -//using Scripts; namespace DeveloperCommandPalette; public sealed class MainListItem : ListItem { private readonly IListItem _listItem; + public IListItem Item => _listItem; + internal MainListItem(IListItem listItem) : base(listItem.Command) { _listItem = listItem; diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/MainListPage.cs b/src/modules/cmdpal/src/WindowsCommandPalette/MainListPage.cs index 8b85e3637580..6fdbbab9e57e 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/MainListPage.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/MainListPage.cs @@ -99,12 +99,12 @@ public MainListSection(MainViewModel viewModel) { this._mainViewModel = viewModel; _Items = new(_mainViewModel.TopLevelCommands.Select(a => new MainListItem(a))); - _Items.CollectionChanged += Bubble_CollectionChanged; ; + _Items.CollectionChanged += Bubble_CollectionChanged; } internal void UpdateQuery(string query) { - var fallbacks = _Items.Select(i => i?.FallbackHandler).Where(fb => fb != null).Select(fb=>fb!); + var fallbacks = _Items.Select(i => i?.FallbackHandler).Where(fb => fb != null).Select(fb => fb!); foreach (var fb in fallbacks) { fb.UpdateQuery(query); @@ -118,6 +118,7 @@ private void Bubble_CollectionChanged(object? sender, NotifyCollectionChangedEve CollectionChanged?.Invoke(this, e); }); } + internal void Reset() { _Items.Clear(); @@ -189,7 +190,7 @@ internal string Query // // instead run the query once when the action query changes, and store the // results. - public IListItem[] Items => itemsToEnumerate.Where(i => i!= null).ToArray(); + public IListItem[] Items => itemsToEnumerate.Where(i => i != null).ToArray(); public FilteredListSection(MainViewModel viewModel) @@ -224,7 +225,7 @@ public sealed class MainListPage : Microsoft.Windows.CommandPalette.Extensions.H public MainListPage(MainViewModel viewModel) { - this._mainViewModel= viewModel; + this._mainViewModel = viewModel; _mainSection = new(_mainViewModel); _recentsListSection = new(_mainViewModel); diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/MainPage.xaml.cs b/src/modules/cmdpal/src/WindowsCommandPalette/MainPage.xaml.cs index da33fe6d7efe..c465c4e8891a 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/MainPage.xaml.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/MainPage.xaml.cs @@ -68,11 +68,16 @@ private static string CreateHash(string? title, string? subtitle) { return title + subtitle; } - private string[] _recentCommandHashes = [];// ["SpotifySpotify", "All Apps", "GitHub Issues", "Microsoft/GithubBookmark"]; + + private string[] _recentCommandHashes = []; + public IEnumerable RecentActions => TopLevelCommands.Where(i => i != null && _recentCommandHashes.Contains(CreateHash(i.Title, i.Subtitle))); - public IEnumerable AppItems => LoadedApps? apps.GetItems().First().Items : []; - public IEnumerable Everything => TopLevelCommands.Concat(AppItems).Where(i => i!= null); - public IEnumerable Recent => _recentCommandHashes.Select(hash => Everything.Where(i => CreateHash(i.Title, i.Subtitle) == hash ).FirstOrDefault()).Where(i => i != null).Select(i=>i!); + + public IEnumerable AppItems => LoadedApps ? apps.GetItems().First().Items : []; + + public IEnumerable Everything => TopLevelCommands.Concat(AppItems).Where(i => i != null); + + public IEnumerable Recent => _recentCommandHashes.Select(hash => Everything.Where(i => CreateHash(i.Title, i.Subtitle) == hash).FirstOrDefault()).Where(i => i != null).Select(i => i!); internal void PushRecentAction(ICommand action) { diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/MainWindow.xaml.cs b/src/modules/cmdpal/src/WindowsCommandPalette/MainWindow.xaml.cs index b17500af4736..d11f7078cc8a 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/MainWindow.xaml.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/MainWindow.xaml.cs @@ -53,20 +53,21 @@ private Windows.Win32.Foundation.LRESULT HotKeyPrc(Windows.Win32.Foundation.HWND return Windows.Win32.PInvoke.CallWindowProc(origPrc, hwnd, uMsg, wParam, lParam); } + public void Summon() { Windows.Win32.PInvoke.ShowWindow(hwnd, Windows.Win32.UI.WindowsAndMessaging.SHOW_WINDOW_CMD.SW_SHOW); Windows.Win32.PInvoke.SetForegroundWindow(hwnd); - //Windows.Win32.PInvoke.SetFocus(hwnd); + // Windows.Win32.PInvoke.SetFocus(hwnd); Windows.Win32.PInvoke.SetActiveWindow(hwnd); MainPage.ViewModel.Summon(); } + public MainWindow() { this.InitializeComponent(); this._mainViewModel = MainPage.ViewModel; - hwnd = new Windows.Win32.Foundation.HWND(WinRT.Interop.WindowNative.GetWindowHandle(this).ToInt32()); _ = SetupHotkey(); @@ -79,6 +80,7 @@ public MainWindow() AppTitleBar.SizeChanged += AppTitleBar_SizeChanged; ExtendsContentIntoTitleBar = true; + // Hide our titlebar. We'll make the sides draggable later m_AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Collapsed; AppTitleTextBlock.Text = AppInfo.Current.DisplayInfo.DisplayName; @@ -87,10 +89,11 @@ public MainWindow() Application.Current.GetService().SaveSettingAsync("ThisIsAVeryBizarreString", true); - //PositionForStartMenu(); + // PositionForStartMenu(); PositionCentered(); _mainViewModel.HideRequested += _mainViewModel_HideRequested; } + private async Task SetupHotkey() { var hotkeySettingString = await Application.Current.GetService().ReadSettingAsync("GlobalHotkey") ?? "win+ctrl+."; @@ -102,6 +105,7 @@ private async Task SetupHotkey() origPrc = Marshal.GetDelegateForFunctionPointer((IntPtr)Windows.Win32.PInvoke.SetWindowLongPtr(hwnd, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC, hotKeyPrcPointer)); } + private void PositionCentered() { m_AppWindow.Resize(new SizeInt32 { Width = 860, Height = 512 }); @@ -146,7 +150,7 @@ private void PositionForStartMenu() } catch (Exception) { - //react appropriately + // react appropriately } Microsoft.UI.Windowing.DisplayArea displayArea = Microsoft.UI.Windowing.DisplayArea.GetFromWindowId(m_AppWindow.Id, Microsoft.UI.Windowing.DisplayAreaFallback.Nearest); @@ -201,9 +205,12 @@ private void SetRegionsForCustomTitleBar() //// Get the rectangle around the content GeneralTransform transform = MainPage.TransformToVisual(null); - Rect bounds = transform.TransformBounds(new Rect(0, 0, - MainPage.ActualWidth, - MainPage.ActualHeight)); + Rect bounds = transform.TransformBounds( + new Rect( + 0, + 0, + MainPage.ActualWidth, + MainPage.ActualHeight)); Windows.Graphics.RectInt32 contentRect = GetRect(bounds, scaleAdjustment); var rectArray = new Windows.Graphics.RectInt32[] { contentRect }; @@ -217,9 +224,9 @@ private void SetRegionsForCustomTitleBar() var h = ContentGrid.ActualHeight; var dragSides = new Windows.Graphics.RectInt32[] { GetRect(new Rect(0, 0, w, 24), scaleAdjustment), - GetRect(new Rect(0, h-24, ContentGrid.ActualWidth, 24), scaleAdjustment), + GetRect(new Rect(0, h - 24, ContentGrid.ActualWidth, 24), scaleAdjustment), GetRect(new Rect(0, 0, 24, h), scaleAdjustment), - GetRect(new Rect(w-24, 0, 24, h), scaleAdjustment), + GetRect(new Rect(w - 24, 0, 24, h), scaleAdjustment), }; nonClientInputSrc.SetRegionRects(NonClientRegionKind.Caption, dragSides); } diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/MarkdownPage.xaml.cs b/src/modules/cmdpal/src/WindowsCommandPalette/MarkdownPage.xaml.cs index 0ceac8978f99..bf83287f1973 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/MarkdownPage.xaml.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/MarkdownPage.xaml.cs @@ -70,7 +70,8 @@ protected override void OnNavigatedTo(NavigationEventArgs e) mdTextBox.Text = ViewModel.MarkdownContent[0]; TitleBlock.Text = ViewModel.Title; } - // if (ViewModel.PageCommand != null) + + // if (ViewModel.PageCommand != null) // { // ActionsDropdown.ItemsSource = ViewModel.PageCommand.Commands; // this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(MoreCommandsAvailable))); @@ -79,6 +80,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e) }); }); } + private void DoAction(ActionViewModel actionViewModel) { ViewModel?.DoAction(actionViewModel); @@ -114,8 +116,8 @@ private void MoreCommandsButton_Tapped(object sender, TappedRoutedEventArgs e) ShowMode = FlyoutShowMode.Standard }; MoreCommandsButton.Flyout.ShowAt(MoreCommandsButton, options); - //ActionsDropdown.SelectedIndex = 0; - //ActionsDropdown.Focus(FocusState.Programmatic); + // ActionsDropdown.SelectedIndex = 0; + // ActionsDropdown.Focus(FocusState.Programmatic); } #pragma warning disable CA1822 // Mark members as static private bool MoreCommandsAvailable => (ViewModel?.Page.Commands != null) && (ViewModel.Page.Commands.Length > 0); diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/PageViewModel.cs b/src/modules/cmdpal/src/WindowsCommandPalette/PageViewModel.cs index 390af1ec64ec..46d4b1017957 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/PageViewModel.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/PageViewModel.cs @@ -19,7 +19,7 @@ public class PageViewModel public bool Nested { get => nested; set => nested = value; } protected IPage pageAction { get; } - //public IPage PageAction { get => pageAction; set => pageAction = value; } + // public IPage PageAction { get => pageAction; set => pageAction = value; } public ActionViewModel Command { get; } public event TypedEventHandler? RequestDoAction; diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/Program.cs b/src/modules/cmdpal/src/WindowsCommandPalette/Program.cs index 6bfeebf51a3b..9ca919144e6f 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/Program.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/Program.cs @@ -55,7 +55,8 @@ private static void OnActivated(object? sender, AppActivationArguments args) { ExtendedActivationKind kind = args.Kind; _ = kind; - //app?. + + // app?. // If we already have a form, display the message now. // Otherwise, add it to the collection for displaying later. if (App.Current is App thisApp) diff --git a/src/modules/cmdpal/src/WindowsCommandPalette/SettingsActionProvider.cs b/src/modules/cmdpal/src/WindowsCommandPalette/SettingsActionProvider.cs index 07c5b4bcbb77..0b33074bf4e3 100644 --- a/src/modules/cmdpal/src/WindowsCommandPalette/SettingsActionProvider.cs +++ b/src/modules/cmdpal/src/WindowsCommandPalette/SettingsActionProvider.cs @@ -82,7 +82,7 @@ private static async Task GetSettingsDataJson() var hotkey = "win+ctrl+."; try { - hotkey = await Application.Current.GetService().ReadSettingAsync("GlobalHotkey") ; + hotkey = await Application.Current.GetService().ReadSettingAsync("GlobalHotkey"); } catch (Exception ex) {