@@ -13,11 +13,10 @@ public sealed partial class WidgetFileTagsContainerItem : ObservableObject, IAsy
1313 private readonly IFileTagsService FileTagsService = Ioc . Default . GetRequiredService < IFileTagsService > ( ) ;
1414 private readonly IImageService ImageService = Ioc . Default . GetRequiredService < IImageService > ( ) ;
1515 private readonly ICommandManager Commands = Ioc . Default . GetRequiredService < ICommandManager > ( ) ;
16+ private IContentPageContext ContentPageContext { get ; } = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
1617
1718 private readonly string _tagUid ;
1819
19- private readonly Func < string , Task > _openAction ;
20-
2120 // Properties
2221
2322 public ObservableCollection < WidgetFileTagCardItem > Tags { get ; }
@@ -46,11 +45,10 @@ public string? Name
4645 public ICommand ViewMoreCommand { get ; }
4746 public ICommand OpenAllCommand { get ; }
4847
49- public WidgetFileTagsContainerItem ( string tagUid , Func < string , Task > openAction )
48+ public WidgetFileTagsContainerItem ( string tagUid )
5049 {
5150 _tagUid = tagUid ;
52- _openAction = openAction ;
53- Tags = [ ] ;
51+ Tags = new ( ) ;
5452
5553 ViewMoreCommand = new AsyncRelayCommand ( ViewMore ) ;
5654 OpenAllCommand = new AsyncRelayCommand ( OpenAll ) ;
@@ -59,21 +57,21 @@ public WidgetFileTagsContainerItem(string tagUid, Func<string, Task> openAction)
5957 /// <inheritdoc/>
6058 public async Task InitAsync ( CancellationToken cancellationToken = default )
6159 {
62- await foreach ( var item in FileTagsService . GetItemsForTagAsync ( _tagUid , cancellationToken ) )
60+ await foreach ( var item in FileTagsService . GetItemsForTagAsync ( _tagUid ) )
6361 {
64- var icon = await ImageService . GetIconAsync ( item . Storable , cancellationToken ) ;
65- Tags . Add ( new ( item . Storable , _openAction , icon ) ) ;
62+ var icon = await ImageService . GetIconAsync ( item . Storable , default ) ;
63+ Tags . Add ( new ( item . Storable , icon ) ) ;
6664 }
6765 }
6866
69- private Task ViewMore ( )
67+ private Task < bool > ViewMore ( )
7068 {
71- return _openAction ( $ "tag:{ Name } ") ;
69+ return NavigationHelpers . OpenPath ( $ "tag:{ Name } ", ContentPageContext . ShellPage ! ) ;
7270 }
7371
7472 private Task OpenAll ( )
7573 {
76- SelectedTagChanged ? . Invoke ( this , new SelectedTagChangedEventArgs ( Tags . Select ( tag => ( tag . Path , tag . IsFolder ) ) ) ) ;
74+ SelectedTagChanged ? . Invoke ( this , new ( Tags . Select ( tag => ( tag . Path , tag . IsFolder ) ) ) ) ;
7775
7876 return Commands . OpenAllTaggedItems . ExecuteAsync ( ) ;
7977 }
0 commit comments