diff --git a/README_Feature.md b/README_Feature.md deleted file mode 100644 index 520f1e4..0000000 --- a/README_Feature.md +++ /dev/null @@ -1,128 +0,0 @@ - -![](nuget.png) -# Plugin.Maui.Feature - -`Plugin.Maui.Feature` provides the ability to do this amazing thing in your .NET MAUI application. - -## Install Plugin - -[![NuGet](https://img.shields.io/nuget/v/Plugin.Maui.Feature.svg?label=NuGet)](https://www.nuget.org/packages/Plugin.Maui.Feature/) - -Available on [NuGet](http://www.nuget.org/packages/Plugin.Maui.Feature). - -Install with the dotnet CLI: `dotnet add package Plugin.Maui.Feature`, or through the NuGet Package Manager in Visual Studio. - -### Supported Platforms - -| Platform | Minimum Version Supported | -|----------|---------------------------| -| iOS | 11+ | -| macOS | 10.15+ | -| Android | 5.0 (API 21) | -| Windows | 11 and 10 version 1809+ | - -## API Usage - -`Plugin.Maui.Feature` provides the `Feature` class that has a single property `Property` that you can get or set. - -You can either use it as a static class, e.g.: `Feature.Default.Property = 1` or with dependency injection: `builder.Services.AddSingleton(Feature.Default);` - -### Permissions - -Before you can start using Feature, you will need to request the proper permissions on each platform. - -#### iOS - -No permissions are needed for iOS. - -#### Android - -No permissions are needed for Android. - -### Dependency Injection - -You will first need to register the `Feature` with the `MauiAppBuilder` following the same pattern that the .NET MAUI Essentials libraries follow. - -```csharp -builder.Services.AddSingleton(Feature.Default); -``` - -You can then enable your classes to depend on `IFeature` as per the following example. - -```csharp -public class FeatureViewModel -{ - readonly IFeature feature; - - public FeatureViewModel(IFeature feature) - { - this.feature = feature; - } - - public void StartFeature() - { - feature.ReadingChanged += (sender, reading) => - { - Console.WriteLine(reading.Thing); - }; - - feature.Start(); - } -} -``` - -### Straight usage - -Alternatively if you want to skip using the dependency injection approach you can use the `Feature.Default` property. - -```csharp -public class FeatureViewModel -{ - public void StartFeature() - { - feature.ReadingChanged += (sender, reading) => - { - Console.WriteLine(feature.Thing); - }; - - Feature.Default.Start(); - } -} -``` - -### Feature - -Once you have created a `Feature` you can interact with it in the following ways: - -#### Events - -##### `ReadingChanged` - -Occurs when feature reading changes. - -#### Properties - -##### `IsSupported` - -Gets a value indicating whether reading the feature is supported on this device. - -##### `IsMonitoring` - -Gets a value indicating whether the feature is actively being monitored. - -#### Methods - -##### `Start()` - -Start monitoring for changes to the feature. - -##### `Stop()` - -Stop monitoring for changes to the feature. - -# Acknowledgements - -This project could not have came to be without these projects and people, thank you! <3 diff --git a/nuget.png b/nuget.png index 8d88947..16f601e 100644 Binary files a/nuget.png and b/nuget.png differ diff --git a/src/Plugin.Maui.Handlers.sln b/src/Plugin.Maui.Handlers.sln index 7b29547..8a600f2 100644 --- a/src/Plugin.Maui.Handlers.sln +++ b/src/Plugin.Maui.Handlers.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 25.0.1704.0 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.Maui.Feature", "Plugin.Maui.Feature\Plugin.Maui.Feature.csproj", "{2012F564-B8C7-4CEB-8495-1BCB1B0EB638}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Plugin.Maui.Handlers", "Plugin.Maui.Handlers\Plugin.Maui.Handlers.csproj", "{2012F564-B8C7-4CEB-8495-1BCB1B0EB638}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/Plugin.Maui.Handlers/Plugin.Maui.Handlers.csproj b/src/Plugin.Maui.Handlers/Plugin.Maui.Handlers.csproj index 3dcd927..4446dce 100644 --- a/src/Plugin.Maui.Handlers/Plugin.Maui.Handlers.csproj +++ b/src/Plugin.Maui.Handlers/Plugin.Maui.Handlers.csproj @@ -29,13 +29,14 @@ true true snupkg - .NET MAUI Handlers Plugin + MAUI Handlers Plugin.Maui.Handlers provides common platform overrides in your .NET MAUI application. MIT True portable icon.png README.md + 1.0.0