You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -15,25 +12,24 @@ This is possible as it acts as a wrapper to your XAML and provides you the event
15
12
16
13
It's also **100% accessible** with each platform seeing/ treating the control as a native button.
17
14
18
-
The [example page](https://github.com/IeuanWalker/Maui.StateButton/blob/master/Demo/ExamplePage.xaml), has a bunch of different design to showcase the usage -
15
+
Check out the [examples](https://github.com/IeuanWalker/Maui.StateButton/tree/master/Demo/Controls/Examplesl), for a bunch of different designs -
19
16
20
17

21
18
22
19
## How to use it?
23
20
Install the [NuGet package](https://www.nuget.org/packages/IeuanWalker.Maui.StateButton/) into your shared project project
24
21
```
25
-
Install-Package IeuanWalker.StateButton
22
+
Install-Package IeuanWalker.Maui.StateButton
26
23
```
27
24
28
25
Then in the MauiProgram.cs, and the StateButton configuration method -
29
26
```csharp
30
-
usingStateButton;
27
+
usingIeuanWalker.Maui.StateButton;
31
28
```
32
29
```csharp
33
30
builder
34
31
.UseMauiApp<App>()
35
-
.UseMauiCommunityToolkit()
36
-
.ConfigureStateButton();
32
+
.UseStateButton();
37
33
```
38
34
39
35
## What can I do with it?
@@ -81,7 +77,7 @@ Simply add a Trigger to any element and bind it to the `State` property of the b
81
77
</Label>
82
78
</stateButton:StateButton>
83
79
```
84
-
More exmaples can be found in the demo app - https://github.com/IeuanWalker/Maui.StateButton/blob/master/Demo/ExamplePage.xaml
80
+
More examples can be found in the demo app - https://github.com/IeuanWalker/Maui.StateButton/tree/master/Demo/Controls/Examples
85
81
86
82
## Accessibility
87
83
The control itself is seen as a native button on both platforms, so inherits the same accessbility attributes. So from a screenreader and keyboard POV it is a native button.
@@ -92,5 +88,11 @@ There are a few things you can do to improve the accessibility -
92
88
93
89
2. Optionally you can also set the [`SemanticProperties.Hint`](https://docs.microsoft.com/en-us/dotnet/maui/fundamentals/accessibility#hint) property. Using this property you can give more context to what the button is for/ will do.
94
90
91
+
For example, setting the `SemanticProperties.Description` to 'Reload', and `SemanticProperties.Hint` to 'Reload list of contacts'. The user using a screen reader will here something like - 'Reload button, Reload list of contacts, double tap to activate'
92
+
93
+
## Recomended usage
94
+
I recommend creating a [`ControlTemplate`](https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/controltemplate?view=net-maui-7.0) so you can easily re-use the control. You can see how i do this in the `Example6` example button ([xaml](https://github.com/IeuanWalker/Maui.StateButton/blob/master/Demo/Controls/Examples/Example6.xaml)/ [c#](https://github.com/IeuanWalker/Maui.StateButton/blob/master/Demo/Controls/Examples/Example6.xaml.cs))
0 commit comments