@@ -206,18 +206,19 @@ public bool IsSearchBoxVisible
206
206
}
207
207
}
208
208
209
+ // SetProperty doesn't seem to properly notify the binding in path bar
209
210
private string ? _PathText ;
210
- [ Obsolete ( "Remove once Omnibar goes out of experimental." ) ]
211
211
public string ? PathText
212
212
{
213
213
get => _PathText ;
214
214
set
215
215
{
216
- if ( SetProperty ( ref _PathText , value ) )
217
- OnPropertyChanged ( nameof ( OmnibarPathModeText ) ) ;
216
+ _PathText = value ;
217
+ OnPropertyChanged ( nameof ( PathText ) ) ;
218
218
}
219
219
}
220
220
221
+
221
222
private bool _IsOmnibarFocused ;
222
223
public bool IsOmnibarFocused
223
224
{
@@ -231,7 +232,7 @@ public bool IsOmnibarFocused
231
232
switch ( OmnibarCurrentSelectedModeName )
232
233
{
233
234
case OmnibarPathModeName :
234
- OmnibarPathModeText =
235
+ PathText =
235
236
string . IsNullOrEmpty ( ContentPageContext . ShellPage ? . ShellViewModel ? . WorkingDirectory )
236
237
? Constants . UserEnvironmentPaths . HomePath
237
238
: ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ;
@@ -253,9 +254,6 @@ public bool IsOmnibarFocused
253
254
private string _OmnibarCurrentSelectedModeName ;
254
255
public string OmnibarCurrentSelectedModeName { get => _OmnibarCurrentSelectedModeName ; set => SetProperty ( ref _OmnibarCurrentSelectedModeName , value ) ; }
255
256
256
- private string _OmnibarPathModeText ;
257
- public string OmnibarPathModeText { get => _OmnibarPathModeText ; set => SetProperty ( ref _OmnibarPathModeText , value ) ; }
258
-
259
257
private CurrentInstanceViewModel _InstanceViewModel ;
260
258
public CurrentInstanceViewModel InstanceViewModel
261
259
{
@@ -694,12 +692,12 @@ public async Task HandleItemNavigationAsync(string path)
694
692
? Constants . UserEnvironmentPaths . HomePath
695
693
: ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ;
696
694
697
- if ( await LaunchApplicationFromPath ( OmnibarPathModeText , workingDir ) )
695
+ if ( await LaunchApplicationFromPath ( PathText , workingDir ) )
698
696
return ;
699
697
700
698
try
701
699
{
702
- if ( ! await Windows . System . Launcher . LaunchUriAsync ( new Uri ( OmnibarPathModeText ) ) )
700
+ if ( ! await Windows . System . Launcher . LaunchUriAsync ( new Uri ( PathText ) ) )
703
701
await DialogDisplayHelper . ShowDialogAsync ( Strings . InvalidItemDialogTitle . GetLocalizedResource ( ) ,
704
702
string . Format ( Strings . InvalidItemDialogContent . GetLocalizedResource ( ) , Environment . NewLine , resFolder . ErrorCode . ToString ( ) ) ) ;
705
703
}
@@ -839,7 +837,6 @@ public async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem p
839
837
Icon = new FontIcon { Glyph = "\uE7BA " } ,
840
838
Text = Strings . SubDirectoryAccessDenied . GetLocalizedResource ( ) ,
841
839
//Foreground = (SolidColorBrush)Application.Current.Resources["SystemControlErrorTextForegroundBrush"],
842
- FontSize = 12
843
840
} ;
844
841
845
842
flyout . Items ? . Add ( flyoutItem ) ;
@@ -859,7 +856,6 @@ public async Task SetPathBoxDropDownFlyoutAsync(MenuFlyout flyout, PathBoxItem p
859
856
{
860
857
Icon = new FontIcon { Glyph = "\uE8B7 " } , // Use font icon as placeholder
861
858
Text = childFolder . Item . Name ,
862
- FontSize = 12
863
859
} ;
864
860
865
861
if ( workingPath != childFolder . Path )
@@ -1032,13 +1028,13 @@ private static async Task<bool> LaunchApplicationFromPath(string currentInput, s
1032
1028
1033
1029
public async Task PopulateOmnibarSuggestionsForPathMode ( )
1034
1030
{
1035
- var result = await SafetyExtensions . IgnoreExceptions ( async ( ) =>
1031
+ var result = await SafetyExtensions . IgnoreExceptions ( ( Func < Task < bool > > ) ( async ( ) =>
1036
1032
{
1037
1033
List < OmnibarPathModeSuggestionModel > ? newSuggestions = [ ] ;
1038
- var pathText = OmnibarPathModeText ;
1034
+ var pathText = this . PathText ;
1039
1035
1040
1036
// If the current input is special, populate navigation history instead.
1041
- if ( string . IsNullOrWhiteSpace ( pathText ) ||
1037
+ if ( string . IsNullOrWhiteSpace ( ( string ) pathText ) ||
1042
1038
pathText is "Home" or "ReleaseNotes" or "Settings" )
1043
1039
{
1044
1040
// Load previously entered path
@@ -1049,9 +1045,9 @@ public async Task PopulateOmnibarSuggestionsForPathMode()
1049
1045
}
1050
1046
else
1051
1047
{
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 ) ;
1055
1051
var folderPath = PathNormalization . GetParentDir ( expandedPath ) ?? expandedPath ;
1056
1052
StorageFolderWithPath folder = await ContentPageContext . ShellPage . ShellViewModel . GetFolderWithPathFromPathAsync ( folderPath ) ;
1057
1053
if ( folder is null )
@@ -1114,7 +1110,7 @@ public async Task PopulateOmnibarSuggestionsForPathMode()
1114
1110
}
1115
1111
1116
1112
return true ;
1117
- } ) ;
1113
+ } ) ) ;
1118
1114
1119
1115
if ( ! result )
1120
1116
{
0 commit comments