diff --git a/src/Files.App.Controls/Omnibar/Omnibar.cs b/src/Files.App.Controls/Omnibar/Omnibar.cs index 80d310061eb5..131ca89f4ef5 100644 --- a/src/Files.App.Controls/Omnibar/Omnibar.cs +++ b/src/Files.App.Controls/Omnibar/Omnibar.cs @@ -219,6 +219,12 @@ internal protected bool TryToggleIsSuggestionsPopupOpen(bool wantToOpen) return false; } + if (CurrentSelectedMode is not null) + { + _textBoxSuggestionsListView.ItemTemplate = CurrentSelectedMode.ItemTemplate; + _textBoxSuggestionsListView.ItemsSource = CurrentSelectedMode.ItemsSource; + } + _textBoxSuggestionsPopup.IsOpen = wantToOpen; GlobalHelper.WriteDebugStringForOmnibar("The suggestions pop-up is open."); diff --git a/src/Files.App.Controls/Omnibar/OmnibarMode.cs b/src/Files.App.Controls/Omnibar/OmnibarMode.cs index e91e05abe24b..c81216c25a08 100644 --- a/src/Files.App.Controls/Omnibar/OmnibarMode.cs +++ b/src/Files.App.Controls/Omnibar/OmnibarMode.cs @@ -35,7 +35,13 @@ protected override void OnApplyTemplate() _modeButton = GetTemplateChild(TemplatePartName_ModeButton) as Button ?? throw new MissingFieldException($"Could not find {TemplatePartName_ModeButton} in the given {nameof(OmnibarMode)}'s style."); - + + RegisterPropertyChangedCallback(ItemsSourceProperty, (d, dp) => + { + if (_ownerRef is not null && _ownerRef.TryGetTarget(out var owner)) + owner.TryToggleIsSuggestionsPopupOpen(true); + }); + Loaded += OmnibarMode_Loaded; _modeButton.PointerEntered += ModeButton_PointerEntered; _modeButton.PointerPressed += ModeButton_PointerPressed; diff --git a/src/Files.App/UserControls/NavigationToolbar.xaml b/src/Files.App/UserControls/NavigationToolbar.xaml index 697ae5df3c36..a9fa7e44ff6a 100644 --- a/src/Files.App/UserControls/NavigationToolbar.xaml +++ b/src/Files.App/UserControls/NavigationToolbar.xaml @@ -407,26 +407,29 @@ - + - + + HotKeys="{x:Bind HotKeys, Mode=OneWay}" />