From 2336f8a6e4d93ecb9921b1c283056b7a1437e660 Mon Sep 17 00:00:00 2001 From: Dan Siegel Date: Thu, 19 Sep 2024 11:34:50 -0600 Subject: [PATCH] docs: essentials docs update --- docs/plugins/essentials/filesystem.md | 12 ++++++++++++ docs/plugins/essentials/index.md | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/docs/plugins/essentials/filesystem.md b/docs/plugins/essentials/filesystem.md index 0d2bde8..c0970dd 100644 --- a/docs/plugins/essentials/filesystem.md +++ b/docs/plugins/essentials/filesystem.md @@ -3,3 +3,15 @@ uid: Plugins.Essentials.FileSystem --- # File System + +The `IFileSystem` interface from Prism Essentials provides a simple to use `DirectoryInfo` object for the AppData, Cache and Public file storage directories. From there is becomes a simple matter of normal File IO to locate, open and save files. + +You can additionally check if a file exists within an App Package: + +```cs +if (await fileSystem.FileExistsAsync("myFile.txt")) +{ + using var stream = await fileSystem.OpenFileAsync("myFile.txt"); + // Do something with the file stream. +} +``` \ No newline at end of file diff --git a/docs/plugins/essentials/index.md b/docs/plugins/essentials/index.md index 1205522..a228c52 100644 --- a/docs/plugins/essentials/index.md +++ b/docs/plugins/essentials/index.md @@ -12,14 +12,33 @@ The API is generally inspired by a combination of Xamarin/.NET MAUI Essentials a Be sure to install `Prism.Plugin.Essentials.Maui` +```cs +builder.UseMauiApp() + .UsePrism(prism => prism.UsePrismEssentials()) +``` + # [WPF](#tab/wpf) Be sure to install `Prism.Plugin.Essentials.Wpf` +```cs +protected override void RegisterTypes(IContainerRegistry containerRegistry) +{ + containerRegistry.UsePrismEssentials(); +} +``` + # [Uno Platform](#tab/uno-platform) Be sure to install `Prism.Plugin.Essentials.Uno.WinUI` +```cs +protected override void RegisterTypes(IContainerRegistry containerRegistry) +{ + containerRegistry.UsePrismEssentials(); +} +``` + --- > [!NOTE]