https://github.com/vapolia/StrokedLabel
Maui Labels with a border !
https://github.com/vapolia/StrokedLabel
Last synced: about 1 month ago
JSON representation
Maui Labels with a border !
- Host: GitHub
- URL: https://github.com/vapolia/StrokedLabel
- Owner: vapolia
- License: mit
- Created: 2024-09-24T07:34:44.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-01-16T08:30:43.000Z (4 months ago)
- Last Synced: 2025-03-17T18:18:07.321Z (about 2 months ago)
- Language: C#
- Homepage:
- Size: 1.02 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-dotnet-maui - StrokedLabel - square)](https://github.com/vapolia/StrokedLabel/stargazers)|[](https://github.com/vapolia/StrokedLabel/commits) (UI)
README
# Stroked Labels
[![NuGet][nuget-img]][nuget-link]

[](https://github.com/vapolia/StrokedLabel/actions/workflows/main.yaml)
[nuget-link]: https://www.nuget.org/packages/Vapolia.StrokedLabel/
[nuget-img]: https://img.shields.io/nuget/v/Vapolia.StrokedLabelPlatforms:
- Android
- iOS# Quick start
Add the above nuget package to your Maui project
```cs
dotnet add package Vapolia.StrokedLabel
```then add this line to your maui app builder:
```c#
using Vapolia.StrokedLabels;
...
builder.UseStrokedLabelBehavior();
```# Usage
Declare the namespace:
```xaml```
Apply the behavior to a label:
```xaml```
Or apply the behavior through a style:
```xaml
<Setter Property="TextColor" Value="LightBlue" />
<Setter Property="stroked:StrokedLabel.StrokeColor" Value="DarkBlue" />
<Setter Property="stroked:StrokedLabel.StrokeWidth" Value="4" />
```
# Examples
See the SampleApp in this repo.
# Limitations
This behavior is working only with the Label's `Text` property. It does not work with the `FormattedText` property (nor `Span`s).
An implementation could be made in the future by using [that code](https://github.com/santaevpavel/OutlineSpan/blob/master/OutlineSpanLib/src/main/kotlin/ru/santaev/outlinespan/OutlineSpan.kt) on android.