From 154179eb8cb40038996cc96fcc827eb6e95cb161 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:33:04 +0200 Subject: [PATCH 1/7] docs(AppData): Tell the User about the LinkBase Property we use in Chefs App csproj files It's a great to know detail, that this will make those Files and even more Folders showing up in your Solution Explorer and keep those in sync. We should tell the User about this option. --- doc/external/StorageFile.md | 41 +++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index ea95c5aae..4d8472b15 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -12,14 +12,51 @@ You need to load app data files on all platforms. Traditional file access method Use the `Windows.Storage.StorageFile` API to read files from your app package. This works the same way on all Uno Platform targets, including WASM. -- Move your data files to be included as `Content` in your project, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. +- Move your data files to be included as `Content` in your projects output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To make sure, you will always have the latest changes included, set the appropriate sub Property: `CopyToOutputDirectory="PreserveNewest"`. ```xml - + ``` + - If you want to not just have these files in your apps output directory with latest changes, then also have your IDE showing them in your **Solution Explorer** and enable you editing them easily as if those would be directly nested in your specific project, you may want to also set another property on the xml element we just added: `LinkBase="AppData"` (or any other Name you want it to show to you as folder name). + + So this will make the full Content Element look like this: + + ```xml + + + + ``` + + And in your Solution Explorer, this will show up like with the blow shown grey text (VS Code) or with an Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). + + ```markdown + root + |-AppData + | |-yourDataContainingFile.json + |-ClientApp/ + | |-ClientApp.csproj + | |-AppData/ *(Linked File)* + | |-yourDataContainingFile.json *(Linked File)* + |-ClientApp.Api/ + | |-ClientApp.Api.csproj + | |-AppData/ *(Linked File)* + | |-yourDataContainingFile.json *(Linked File)* + |-ClientApp.IntegrationTests/... + |-ClientApp.UITests/... + |-ClientApp.UnitTests/... + ``` + + > [!TIP] + > Another advantage of setting the LinkBase Property like shown above is, that you can do this on every project in your Solution you like to, without being required to: + > + > - duplicate the Folder or Files + > - if you edit a file in there, it's State will always be synced + > [!TIP] + > If you may not want to have those files in your output directory of the Project, but showing up in your Solution Explorer, you can set the `CopyToOutputDirectory` property shown before, to **Never**. + - Loading a JSON File Using StorageFile ```csharp From b5fc3e52500e0090a187b460d3d3e83174ef14ef Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:44:11 +0200 Subject: [PATCH 2/7] chore: apply review suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index 4d8472b15..abd1c7c88 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -12,7 +12,7 @@ You need to load app data files on all platforms. Traditional file access method Use the `Windows.Storage.StorageFile` API to read files from your app package. This works the same way on all Uno Platform targets, including WASM. -- Move your data files to be included as `Content` in your projects output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To make sure, you will always have the latest changes included, set the appropriate sub Property: `CopyToOutputDirectory="PreserveNewest"`. +- Move your data files to be included as `Content` in your project's output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To make sure, you will always have the latest changes included, set the appropriate sub Property: `CopyToOutputDirectory="PreserveNewest"`. ```xml From 0f75b287d62e516d5a45da73732fa7ee5ba5f027 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:44:36 +0200 Subject: [PATCH 3/7] chore: apply review suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index abd1c7c88..889790f00 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -30,7 +30,7 @@ Use the `Windows.Storage.StorageFile` API to read files from your app package. T ``` - And in your Solution Explorer, this will show up like with the blow shown grey text (VS Code) or with an Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). + And in your Solution Explorer, this will show up like with the blow shown grey text (VS Code) or with a Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). ```markdown root From 9b9b5d010b9a2185a9889af47876cb187ff3b292 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:44:52 +0200 Subject: [PATCH 4/7] chore: apply review suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index 889790f00..55763e8df 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -53,7 +53,7 @@ Use the `Windows.Storage.StorageFile` API to read files from your app package. T > Another advantage of setting the LinkBase Property like shown above is, that you can do this on every project in your Solution you like to, without being required to: > > - duplicate the Folder or Files - > - if you edit a file in there, it's State will always be synced + > - if you edit a file in there, its state will always be synced > [!TIP] > If you may not want to have those files in your output directory of the Project, but showing up in your Solution Explorer, you can set the `CopyToOutputDirectory` property shown before, to **Never**. From ed814be44599a34e9a15148f8c7cafa60ee7ead8 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:45:21 +0200 Subject: [PATCH 5/7] chore: apply review suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index 55763e8df..c03483203 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -20,7 +20,7 @@ Use the `Windows.Storage.StorageFile` API to read files from your app package. T ``` - - If you want to not just have these files in your apps output directory with latest changes, then also have your IDE showing them in your **Solution Explorer** and enable you editing them easily as if those would be directly nested in your specific project, you may want to also set another property on the xml element we just added: `LinkBase="AppData"` (or any other Name you want it to show to you as folder name). + - If you want to not just have these files in your app's output directory with latest changes, then also have your IDE showing them in your **Solution Explorer** and enable you editing them easily as if those would be directly nested in your specific project, you may want to also set another property on the xml element we just added: `LinkBase="AppData"` (or any other Name you want it to show to you as folder name). So this will make the full Content Element look like this: From 5984c17a2ea1dd12fd7f34b4911eccfdeb079d04 Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Sat, 26 Jul 2025 20:49:32 +0200 Subject: [PATCH 6/7] chore: apply review suggestion --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index c03483203..a0ee11dd9 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -30,7 +30,7 @@ Use the `Windows.Storage.StorageFile` API to read files from your app package. T ``` - And in your Solution Explorer, this will show up like with the blow shown grey text (VS Code) or with a Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). + And in your Solution Explorer, this will show up like with the below shown grey text (VS Code) or with a Link Arrow like you may know it from .ink files on your Desktop (Visual Studio 2022). ```markdown root From 9994642cb4f94a67bcc534ca72992c8dc39b15bd Mon Sep 17 00:00:00 2001 From: DevTKSS Date: Thu, 27 Nov 2025 21:12:49 +0100 Subject: [PATCH 7/7] chore: applying PR rewording suggestion Co-authored-by: Steve Bilogan --- doc/external/StorageFile.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/external/StorageFile.md b/doc/external/StorageFile.md index a0ee11dd9..883dba81f 100644 --- a/doc/external/StorageFile.md +++ b/doc/external/StorageFile.md @@ -12,7 +12,7 @@ You need to load app data files on all platforms. Traditional file access method Use the `Windows.Storage.StorageFile` API to read files from your app package. This works the same way on all Uno Platform targets, including WASM. -- Move your data files to be included as `Content` in your project's output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To make sure, you will always have the latest changes included, set the appropriate sub Property: `CopyToOutputDirectory="PreserveNewest"`. +- Move your data files to be included as `Content` in your project's output directory, and use `StorageFile.GetFileFromApplicationUriAsync` to load them by path. To ensure that you will always have the latest changes included, set the appropriate Property: `CopyToOutputDirectory="PreserveNewest"`. ```xml