Repository: files-community/Files
File: src/Files.App/Actions/FileSystem/CreateAlternateDataStreamAction.cs (C#)

Code before:
				if (!Win32Helper.WriteStringToFile($"{selectedItem.ItemPath}:{userInput}", ""))
				{
					var dialog = new ContentDialog
					{
						Title = Strings.ErrorCreatingDataStreamTitle.GetLocalizedResource(),
						Content = Strings.ErrorCreatingDataStreamDescription.GetLocalizedResource(),
						PrimaryButtonText = "Ok".GetLocalizedResource()
					};

					if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
						dialog.XamlRoot = MainWindow.Instance.Content.XamlRoot;

					await dialog.TryShowAsync();
				}

				// Restore read-only attribute (#7534)
				if (isReadOnly)
					Win32Helper.SetFileAttribute(selectedItem.ItemPath, System.IO.FileAttributes.ReadOnly);

				// Restore date modified
				if (isDateOk)
					Win32Helper.SetFileDateModified(selectedItem.ItemPath, dateModified);
			}));

			if (context.ShellPage is not null)
				await context.ShellPage.Refresh_Click();
		}

		private void Context_PropertyChanged(object? sender, PropertyChangedEventArgs e)
		{
			switch (e.PropertyName)
			{
				case nameof(IContentPageContext.HasSelection):
				case nameof(IContentPageContext.CanCreateItem):
					OnPropertyChanged(nameof(IsExecutable));
					break;
			}
		}
	}
}


Review comment (suggestion):
I don't know how to fix it, but if you fix ShellViewModel.WatchForDirectoryChanges to work with the addition of alternate data streams, you won't need to refresh the page here.
At least, refreshing should only be done if the setting to display alternate data streams is on.

Code after:

				if (!Win32Helper.WriteStringToFile($"{selectedItem.ItemPath}:{userInput}", ""))
				{
					var dialog = new ContentDialog
					{
						Title = Strings.ErrorCreatingDataStreamTitle.GetLocalizedResource(),
						Content = Strings.ErrorCreatingDataStreamDescription.GetLocalizedResource(),
						PrimaryButtonText = "Ok".GetLocalizedResource()
					};

					if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
						dialog.XamlRoot = MainWindow.Instance.Content.XamlRoot;

					await dialog.TryShowAsync();
				}

				// Restore read-only attribute (#7534)
				if (isReadOnly)
					Win32Helper.SetFileAttribute(selectedItem.ItemPath, System.IO.FileAttributes.ReadOnly);

				// Restore date modified
				if (isDateOk)
					Win32Helper.SetFileDateModified(selectedItem.ItemPath, dateModified);
			}));

			if (context.ShellPage is null)
				return;

			if (FoldersSettingsService.AreAlternateStreamsVisible)
				await context.ShellPage.Refresh_Click();
			else if (ApplicationSettingsService.ShowDataStreamsAreHiddenPrompt)
			{
				var dialog = new ContentDialog
				{
					Title = Strings.DataStreamsAreHiddenTitle.GetLocalizedResource(),
					Content = Strings.DataStreamsAreHiddenDescription.GetLocalizedResource(),
					PrimaryButtonText = Strings.Yes.GetLocalizedResource(),
					SecondaryButtonText = Strings.DontShowAgain.GetLocalizedResource()
				};

				if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
					dialog.XamlRoot = MainWindow.Instance.Content.XamlRoot;

				var result = await dialog.TryShowAsync();
				if (result == ContentDialogResult.Primary)
				{
					FoldersSettingsService.AreAlternateStreamsVisible = true;
					await context.ShellPage.Refresh_Click();
				}
				else
					ApplicationSettingsService.ShowDataStreamsAreHiddenPrompt = false;