Vapolia.SegmentedViews
1.0.2
Prefix Reserved
See the version list below for details.
dotnet add package Vapolia.SegmentedViews --version 1.0.2
NuGet\Install-Package Vapolia.SegmentedViews -Version 1.0.2
<PackageReference Include="Vapolia.SegmentedViews" Version="1.0.2" />
paket add Vapolia.SegmentedViews --version 1.0.2
#r "nuget: Vapolia.SegmentedViews, 1.0.2"
// Install Vapolia.SegmentedViews as a Cake Addin #addin nuget:?package=Vapolia.SegmentedViews&version=1.0.2 // Install Vapolia.SegmentedViews as a Cake Tool #tool nuget:?package=Vapolia.SegmentedViews&version=1.0.2
Vapolia.SegmentedViews
dotnet add package Vapolia.SegmentedViews
builder.UseSegmentedView();
Platforms:
- Android
- iOS
Supports both static segments and ItemsSource
to build segments dynamically.
Quick start
Add the above nuget package to your Maui project
then add this line to your maui app builder:
using Vapolia.SegmentedViews;
...
builder.UseSegmentedView();
Examples
See the SampleApp in this repo.
Declare the namespace:
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
...
xmlns:segmented="https://vapolia.eu/Vapolia.SegmentedViews">
Add a static segment view:
<segmented:SegmentedView
x:Name="TheSegmentView"
SelectedIndex="0"
SelectedTextColor="White" TextColor="Black" SelectedBackgroundColor="Blue" DisabledColor="LightGray"
SelectionChangedCommand="{Binding SegmentSelectionChangedCommand}"
SelectedItem="{Binding SegmentSelectedItem}">
<segmented:Segment Item="Item1" />
<segmented:Segment Item="Item2" />
<segmented:Segment Item="Item3" />
<segmented:Segment Item="Item4" />
<segmented:Segment Item="{Binding Item5Title}" />
</segmented:SegmentedView>
Or a dynamic segment view:
<segmented:SegmentedView
ItemsSource="{Binding Persons}"
TextPropertyName="LastName"
SelectedIndex="0"
SelectedItem="{Binding SegmentSelectedItem}"
SelectedTextColor="White" TextColor="Black" SelectedBackgroundColor="Blue" DisabledColor="LightGray"
SelectionChangedCommand="{Binding SegmentSelectionChangedCommand}" />
Width of segment items
The width of a segment can be set in the following 3 ways, in reverse order of priority:
- On the
ItemsDefaultWidth
property ofSegmentedView
<segmented:SegmentedView
x:Name="TheSegmentView"
SelectedIndex="0"
SelectedTextColor="White" TextColor="Black" SelectedBackgroundColor="Blue" DisabledColor="LightGray"
SelectionChangedCommand="{Binding SegmentSelectionChangedCommand}"
SelectedItem="{Binding SegmentSelectedItem}"
ItemsDefaultWidth="150" />
- On the
ItemsWidthDefinitions
property ofSegmentedView
<segmented:SegmentedView
x:Name="TheSegmentView"
SelectedIndex="0"
SelectedTextColor="White" TextColor="Black" SelectedBackgroundColor="Blue" DisabledColor="LightGray"
SelectionChangedCommand="{Binding SegmentSelectionChangedCommand}"
SelectedItem="{Binding SegmentSelectedItem}"
ItemsWidthDefinitions="150,Auto,*,2*">
This width follow the format of a Grid's ColumnsDefinition, so it should be straightforward to use.
- Directly on the
Width
property of aSegment
<segmented:Segment Item="Item1" Width="150" />
<segmented:Segment Item="Item1" Width="Auto" />
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0-android34.0 is compatible. net8.0-ios17.2 is compatible. |
-
net8.0-android34.0
- Microsoft.Maui.Controls (>= 8.0.10)
-
net8.0-ios17.2
- Microsoft.Maui.Controls (>= 8.0.10)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.6 | 371 | 8/27/2024 |
1.0.5 | 130 | 8/15/2024 |
1.0.4 | 404 | 4/15/2024 |
1.0.3 | 128 | 3/31/2024 |
1.0.2 | 126 | 3/16/2024 |
1.0.1 | 128 | 3/14/2024 |
1.0.0 | 137 | 3/5/2024 |
1.0.0-ci8141352883 | 109 | 3/4/2024 |
1.0.0-ci8139282302 | 81 | 3/4/2024 |
1.0.0-ci8113045545 | 107 | 3/1/2024 |
1.0.0-ci8016228389 | 108 | 2/23/2024 |
1.0.1: Upgrade nugets. Remove dependency on maui compatibility.
1.0.0: Initial release