@@ -11,6 +11,8 @@ internal sealed class CreateAlternateDataStreamAction : BaseUIAction, IAction
1111 {
1212 private readonly IContentPageContext context ;
1313
14+ private static readonly IFoldersSettingsService FoldersSettingsService = Ioc . Default . GetRequiredService < IFoldersSettingsService > ( ) ;
15+
1416 public string Label
1517 => "CreateAlternateDataStream" . GetLocalizedResource ( ) ;
1618
@@ -72,8 +74,31 @@ await Task.WhenAll(context.SelectedItems.Select(async selectedItem =>
7274 Win32Helper . SetFileDateModified ( selectedItem . ItemPath , dateModified ) ;
7375 } ) ) ;
7476
75- if ( context . ShellPage is not null )
77+ if ( context . ShellPage is null )
78+ return ;
79+
80+ if ( FoldersSettingsService . AreAlternateStreamsVisible )
7681 await context . ShellPage . Refresh_Click ( ) ;
82+ else
83+ {
84+ var dialog = new ContentDialog
85+ {
86+ Title = Strings . DataStreamsAreHiddenTitle . GetLocalizedResource ( ) ,
87+ Content = Strings . DataStreamsAreHiddenDescription . GetLocalizedResource ( ) ,
88+ PrimaryButtonText = Strings . Yes . GetLocalizedResource ( ) ,
89+ SecondaryButtonText = Strings . No . GetLocalizedResource ( )
90+ } ;
91+
92+ if ( ApiInformation . IsApiContractPresent ( "Windows.Foundation.UniversalApiContract" , 8 ) )
93+ dialog . XamlRoot = MainWindow . Instance . Content . XamlRoot ;
94+
95+ var result = await dialog . TryShowAsync ( ) ;
96+ if ( result == ContentDialogResult . Primary )
97+ {
98+ FoldersSettingsService . AreAlternateStreamsVisible = true ;
99+ await context . ShellPage . Refresh_Click ( ) ;
100+ }
101+ }
77102 }
78103
79104 private void Context_PropertyChanged ( object ? sender , PropertyChangedEventArgs e )
0 commit comments