@@ -206,18 +206,19 @@ public bool IsSearchBoxVisible
206206 }
207207 }
208208
209+ // SetProperty doesn't seem to properly notify the binding in path bar
209210 private string ? _PathText ;
210- [ Obsolete ( "Remove once Omnibar goes out of experimental." ) ]
211211 public string ? PathText
212212 {
213213 get => _PathText ;
214214 set
215215 {
216- if ( SetProperty ( ref _PathText , value ) )
217- OnPropertyChanged ( nameof ( OmnibarPathModeText ) ) ;
216+ _PathText = value ;
217+ OnPropertyChanged ( nameof ( PathText ) ) ;
218218 }
219219 }
220220
221+
221222 private bool _IsOmnibarFocused ;
222223 public bool IsOmnibarFocused
223224 {
@@ -231,7 +232,7 @@ public bool IsOmnibarFocused
231232 switch ( OmnibarCurrentSelectedModeName )
232233 {
233234 case OmnibarPathModeName :
234- OmnibarPathModeText =
235+ PathText =
235236 string . IsNullOrEmpty ( ContentPageContext . ShellPage ? . ShellViewModel ? . WorkingDirectory )
236237 ? Constants . UserEnvironmentPaths . HomePath
237238 : ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ;
@@ -253,9 +254,6 @@ public bool IsOmnibarFocused
253254 private string _OmnibarCurrentSelectedModeName ;
254255 public string OmnibarCurrentSelectedModeName { get => _OmnibarCurrentSelectedModeName ; set => SetProperty ( ref _OmnibarCurrentSelectedModeName , value ) ; }
255256
256- private string _OmnibarPathModeText ;
257- public string OmnibarPathModeText { get => _OmnibarPathModeText ; set => SetProperty ( ref _OmnibarPathModeText , value ) ; }
258-
259257 private CurrentInstanceViewModel _InstanceViewModel ;
260258 public CurrentInstanceViewModel InstanceViewModel
261259 {
@@ -694,12 +692,12 @@ public async Task HandleItemNavigationAsync(string path)
694692 ? Constants . UserEnvironmentPaths . HomePath
695693 : ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ;
696694
697- if ( await LaunchApplicationFromPath ( OmnibarPathModeText , workingDir ) )
695+ if ( await LaunchApplicationFromPath ( PathText , workingDir ) )
698696 return ;
699697
700698 try
701699 {
702- if ( ! await Windows . System . Launcher . LaunchUriAsync ( new Uri ( OmnibarPathModeText ) ) )
700+ if ( ! await Windows . System . Launcher . LaunchUriAsync ( new Uri ( PathText ) ) )
703701 await DialogDisplayHelper . ShowDialogAsync ( Strings . InvalidItemDialogTitle . GetLocalizedResource ( ) ,
704702 string . Format ( Strings . InvalidItemDialogContent . GetLocalizedResource ( ) , Environment . NewLine , resFolder . ErrorCode . ToString ( ) ) ) ;
705703 }
@@ -839,7 +837,6 @@ public async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem p
839837 Icon = new FontIcon { Glyph = "\uE7BA " } ,
840838 Text = Strings . SubDirectoryAccessDenied . GetLocalizedResource ( ) ,
841839 //Foreground = (SolidColorBrush)Application.Current.Resources["SystemControlErrorTextForegroundBrush"],
842- FontSize = 12
843840 } ;
844841
845842 flyout . Items ? . Add ( flyoutItem ) ;
@@ -859,7 +856,6 @@ public async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem p
859856 {
860857 Icon = new FontIcon { Glyph = "\uE8B7 " } , // Use font icon as placeholder
861858 Text = childFolder . Item . Name ,
862- FontSize = 12
863859 } ;
864860
865861 if ( workingPath != childFolder . Path )
@@ -1032,13 +1028,13 @@ private static async Task<bool> LaunchApplicationFromPath(string currentInput, s
10321028
10331029 public async Task PopulateOmnibarSuggestionsForPathMode ( )
10341030 {
1035- var result = await SafetyExtensions . IgnoreExceptions ( async ( ) =>
1031+ var result = await SafetyExtensions . IgnoreExceptions ( ( Func < Task < bool > > ) ( async ( ) =>
10361032 {
10371033 List < OmnibarPathModeSuggestionModel > ? newSuggestions = [ ] ;
1038- var pathText = OmnibarPathModeText ;
1034+ var pathText = this . PathText ;
10391035
10401036 // If the current input is special, populate navigation history instead.
1041- if ( string . IsNullOrWhiteSpace ( pathText ) ||
1037+ if ( string . IsNullOrWhiteSpace ( ( string ) pathText ) ||
10421038 pathText is "Home" or "ReleaseNotes" or "Settings" )
10431039 {
10441040 // Load previously entered path
@@ -1049,9 +1045,9 @@ public async Task PopulateOmnibarSuggestionsForPathMode()
10491045 }
10501046 else
10511047 {
1052- var isFtp = FtpHelpers . IsFtpPath ( pathText ) ;
1053- pathText = NormalizePathInput ( pathText , isFtp ) ;
1054- var expandedPath = StorageFileExtensions . GetResolvedPath ( pathText , isFtp ) ;
1048+ var isFtp = FtpHelpers . IsFtpPath ( ( string ) pathText ) ;
1049+ pathText = NormalizePathInput ( ( string ) pathText , isFtp ) ;
1050+ var expandedPath = StorageFileExtensions . GetResolvedPath ( ( string ) pathText , isFtp ) ;
10551051 var folderPath = PathNormalization . GetParentDir ( expandedPath ) ?? expandedPath ;
10561052 StorageFolderWithPath folder = await ContentPageContext . ShellPage . ShellViewModel . GetFolderWithPathFromPathAsync ( folderPath ) ;
10571053 if ( folder is null )
@@ -1114,7 +1110,7 @@ public async Task PopulateOmnibarSuggestionsForPathMode()
11141110 }
11151111
11161112 return true ;
1117- } ) ;
1113+ } ) ) ;
11181114
11191115 if ( ! result )
11201116 {
0 commit comments