From 8f036ccb993c7aaf637f1269a56fb3f2d3a4f4a8 Mon Sep 17 00:00:00 2001 From: Qiutong Shen Date: Thu, 23 Apr 2026 11:17:37 +0800 Subject: [PATCH 1/2] Fix WinUI 3 migration issues in files/ documentation - index.md: Mark HomeGroup as deprecated (removed in Windows 10 1803), update SD card description, add note about WinRT API applicability - track-recently-used-files-folders.md: Fix FileOpenPicker link (was pointing to manifest schema, now points to API), fix grammar, update file picker prerequisite link to relative path - list-files-folders.md: Fix grammar, add UWP sample compatibility note, fix non-breaking space character Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- hub/apps/develop/files/index.md | 7 +++++-- hub/apps/develop/files/list-files-folders.md | 4 ++-- .../develop/files/track-recently-used-files-folders.md | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hub/apps/develop/files/index.md b/hub/apps/develop/files/index.md index 37003e97d5..0ebb97b6fe 100644 --- a/hub/apps/develop/files/index.md +++ b/hub/apps/develop/files/index.md @@ -59,18 +59,21 @@ For examples of using the .NET APIs in a WinUI app, see [Access files and folder If you're developing packaged WinUI apps, the WinRT storage APIs can be a powerful tool for reading and writing data. The following topics provide a wealth of information for developers looking to leverage these APIs in their apps. +> [!NOTE] +> The topics below link to WinRT API documentation which is applicable to both UWP and WinUI 3 (Windows App SDK) apps. + | Topic | Description | |-------|-------------| | [Enumerate and query files and folders](/windows/uwp/files/quickstart-listing-files-and-folders) | Access files and folders in either a folder, library, device, or network location. You can also query the files and folders in a location by constructing file and folder queries. | | [Create, write, and read a file](/windows/uwp/files/quickstart-reading-and-writing-files) | Read and write a file using a [StorageFile](/uwp/api/Windows.Storage.StorageFile) object. | | [Best practices for writing to files](/windows/uwp/files/best-practices-for-writing-to-files) | Learn best practices for using various file writing methods of the [FileIO](/uwp/api/windows.storage.fileio) and [PathIO](/uwp/api/windows.storage.pathio) classes. | | [Get file properties](/windows/uwp/files/quickstart-getting-file-properties) | Get properties—top-level, basic, and extended—for a file represented by a [StorageFile](/uwp/api/Windows.Storage.StorageFile) object. | -| [Accessing HomeGroup content](/windows/uwp/files/quickstart-accessing-homegroup-content) | Access content stored in the user's HomeGroup folder, including pictures, music, and videos. | +| [Accessing HomeGroup content](/windows/uwp/files/quickstart-accessing-homegroup-content) | ~~Access content stored in the user's HomeGroup folder.~~ **Note: HomeGroup was removed in Windows 10 version 1803.** | | [Determining availability of Microsoft OneDrive files](/windows/uwp/files/quickstart-determining-availability-of-microsoft-onedrive-files) | Determine if a Microsoft OneDrive file is available using the [StorageFile.IsAvailable](/uwp/api/windows.storage.storagefile.isavailable) property. | | [Files and folders in the Music, Pictures, and Videos libraries](/windows/uwp/files/quickstart-managing-folders-in-the-music-pictures-and-videos-libraries) | Add existing folders of music, pictures, or videos to the corresponding libraries. You can also remove folders from libraries, get the list of folders in a library, and discover stored photos, music, and videos. | | [Track recently used files and folders](/windows/uwp/files/how-to-track-recently-used-files-and-folders) | Track files that your user accesses frequently by adding them to your app's most recently used list (MRU). The platform manages the MRU for you by sorting items based on when they were last accessed, and by removing the oldest item when the list's 25-item limit is reached. All apps have their own MRU. | | [Track file system changes in the background](/windows/uwp/files/change-tracking-filesystem) | Track changes to the file system, even when the app isn't running.| -| [Access the SD card](/windows/uwp/files/access-the-sd-card) | You can store and access non-essential data on an optional microSD card, especially on low-cost mobile devices that have limited internal storage. | +| [Access the SD card](/windows/uwp/files/access-the-sd-card) | Store and access non-essential data on removable storage media (primarily applicable to devices with SD card slots). | | [Fast access to file properties](/windows/uwp/files/fast-file-properties) | Efficiently gather a list of files and their properties from a library to use via the Windows Runtime APIs. | ## See also diff --git a/hub/apps/develop/files/list-files-folders.md b/hub/apps/develop/files/list-files-folders.md index c549cc316d..fa01676736 100644 --- a/hub/apps/develop/files/list-files-folders.md +++ b/hub/apps/develop/files/list-files-folders.md @@ -17,13 +17,13 @@ Access files and folders in either a folder, library, device, or network locatio For guidance on how to store your WinUI app's data, see the [ApplicationData](/uwp/api/windows.storage.applicationdata) class. > [!NOTE] -> For a complete sample, see the [Folder enumeration sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FolderEnumeration). +> For a complete sample, see the [Folder enumeration sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/FolderEnumeration) (UWP sample - uses the same WinRT APIs as WinUI 3 apps). ## Prerequisites - **Understand async programming for WinUI apps** - You can learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++/WinRT, see [Concurrency and asynchronous operations with C++/WinRT](/windows/uwp/cpp-and-winrt-apis/concurrency). + To learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++/WinRT, see [Concurrency and asynchronous operations with C++/WinRT](/windows/uwp/cpp-and-winrt-apis/concurrency). - **Access permissions to the location** diff --git a/hub/apps/develop/files/track-recently-used-files-folders.md b/hub/apps/develop/files/track-recently-used-files-folders.md index e7a9a83852..d1124263e1 100644 --- a/hub/apps/develop/files/track-recently-used-files-folders.md +++ b/hub/apps/develop/files/track-recently-used-files-folders.md @@ -12,7 +12,7 @@ ms.localizationpriority: medium **Important APIs** - [MostRecentlyUsedList](/uwp/api/windows.storage.accesscache.storageapplicationpermissions.mostrecentlyusedlist) -- [FileOpenPicker](/uwp/schemas/appxpackage/appxmanifestschema/element-fileopenpicker) +- [FileOpenPicker](/uwp/api/windows.storage.pickers.fileopenpicker) Track files that your user accesses frequently by adding them to your app's most recently used list (MRU). The platform manages the MRU for you by sorting items based on when they were last accessed, and by removing the oldest item when the list's 25-item limit is reached. All apps have their own MRU. @@ -25,13 +25,13 @@ Your app's MRU is represented by the [StorageItemMostRecentlyUsedList](/uwp/api/ - **Understand async programming for WinUI apps** - You can learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++, see [Asynchronous programming in C++](/windows/uwp/threading-async/asynchronous-programming-in-cpp-universal-windows-platform-apps). + To learn how to write asynchronous apps in C#, see [Call asynchronous APIs in C# or Visual Basic](/windows/uwp/threading-async/call-asynchronous-apis-in-csharp-or-visual-basic). To learn how to write asynchronous apps in C++, see [Asynchronous programming in C++](/windows/uwp/threading-async/asynchronous-programming-in-cpp-universal-windows-platform-apps). - **Access permissions to the location** See [File access permissions](file-access-permissions.md). -- [Open files and folders with a picker](/windows/uwp/files/quickstart-using-file-and-folder-pickers) +- [Open files and folders with a picker](file-pickers.md) Picked files are often the same files that users return to again and again. From 840030f7129aab6de184f8fc97dc7dce5c702664 Mon Sep 17 00:00:00 2001 From: Qiutong Shen Date: Thu, 23 Apr 2026 14:11:54 +0800 Subject: [PATCH 2/2] Add missed files: ListView links and HomeGroup deprecation - music-pictures-videos-libraries.md: Update ListView links to WinUI 3 API - file-access-permissions.md: Mark HomeGroup as deprecated (removed in Windows 10 1803) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- hub/apps/develop/files/file-access-permissions.md | 2 +- hub/apps/develop/files/music-pictures-videos-libraries.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hub/apps/develop/files/file-access-permissions.md b/hub/apps/develop/files/file-access-permissions.md index 4f95e4a501..d6be83b0db 100644 --- a/hub/apps/develop/files/file-access-permissions.md +++ b/hub/apps/develop/files/file-access-permissions.md @@ -192,7 +192,7 @@ The following table lists additional locations that you can access by declaring | Pictures | picturesLibrary
Also see [Files and folders in the Music, Pictures, and Videos libraries](music-pictures-videos-libraries.md). | [KnownFolders.PicturesLibrary](/uwp/api/windows.storage.knownfolders.pictureslibrary) | | Videos | videosLibrary
Also see [Files and folders in the Music, Pictures, and Videos libraries](music-pictures-videos-libraries.md). | [KnownFolders.VideosLibrary](/uwp/api/windows.storage.knownfolders.videoslibrary) | | Removable devices | removableStorage

Note You must add File Type Associations to your app manifest that declare specific file types that your app can access in this location.

Also see [Access the SD card](/windows/uwp/files/access-the-sd-card). | [KnownFolders.RemovableDevices](/uwp/api/windows.storage.knownfolders.removabledevices) | -| Homegroup libraries | At least one of the following capabilities is needed.
- musicLibrary
- picturesLibrary
- videosLibrary | [KnownFolders.HomeGroup](/uwp/api/windows.storage.knownfolders.homegroup) | +| Homegroup libraries | **Deprecated.** HomeGroup was removed in Windows 10, version 1803. At least one of the following capabilities is needed.
- musicLibrary
- picturesLibrary
- videosLibrary | [KnownFolders.HomeGroup](/uwp/api/windows.storage.knownfolders.homegroup) | | Media server devices (DLNA) | At least one of the following capabilities is needed.
- musicLibrary
- picturesLibrary
- videosLibrary | [KnownFolders.MediaServerDevices](/uwp/api/windows.storage.knownfolders.mediaserverdevices) | | Universal Naming Convention (UNC) folders | A combination of the following capabilities is needed.

The home and work networks capability:
- privateNetworkClientServer

And at least one internet and public networks capability:
- internetClient
- internetClientServer

And, if applicable, the domain credentials capability:
- enterpriseAuthentication

**Note:** You must add File Type Associations to your app manifest that declare specific file types that your app can access in this location. | Retrieve a folder using:
[StorageFolder.GetFolderFromPathAsync](/uwp/api/windows.storage.storagefolder.getfolderfrompathasync)

Retrieve a file using:
[StorageFile.GetFileFromPathAsync](/uwp/api/windows.storage.storagefile.getfilefrompathasync) | diff --git a/hub/apps/develop/files/music-pictures-videos-libraries.md b/hub/apps/develop/files/music-pictures-videos-libraries.md index b4351c76ae..389415e530 100644 --- a/hub/apps/develop/files/music-pictures-videos-libraries.md +++ b/hub/apps/develop/files/music-pictures-videos-libraries.md @@ -76,11 +76,11 @@ Windows.Storage.StorageFolder newFolder = await myPictures.RequestAddFolderAsync ## Remove a folder from a library -To remove a folder from a library, call the [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage.storagelibrary.requestremovefolderasync) method and specify the folder to be removed. You could use [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) and a [ListView](/uwp/api/Windows.UI.Xaml.Controls.ListView) control (or similar) for the user to select a folder to remove. +To remove a folder from a library, call the [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage.storagelibrary.requestremovefolderasync) method and specify the folder to be removed. You could use [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) and a [ListView](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.listview) control (or similar) for the user to select a folder to remove. When you call [StorageLibrary.RequestRemoveFolderAsync](/uwp/api/windows.storage.storagelibrary.requestremovefolderasync), the user sees a confirmation dialog saying that the folder "won't appear in Pictures anymore, but won't be deleted." What this means is that the folder remains in its original location on disk, is removed from the [StorageLibrary.Folders](/uwp/api/windows.storage.storagelibrary.folders) property, and will no longer included in the built-in Photos app. -The following example assumes that the user has selected the folder to remove from a [ListView](/uwp/api/Windows.UI.Xaml.Controls.ListView) control named lvPictureFolders. +The following example assumes that the user has selected the folder to remove from a [ListView](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.listview) control named lvPictureFolders. ```csharp