Vapolia.SegmentedViews
1.0.8
Prefix Reserved
See the version list below for details.
dotnet add package Vapolia.SegmentedViews --version 1.0.8
NuGet\Install-Package Vapolia.SegmentedViews -Version 1.0.8
<PackageReference Include="Vapolia.SegmentedViews" Version="1.0.8" />
<PackageVersion Include="Vapolia.SegmentedViews" Version="1.0.8" />
<PackageReference Include="Vapolia.SegmentedViews" />
paket add Vapolia.SegmentedViews --version 1.0.8
#r "nuget: Vapolia.SegmentedViews, 1.0.8"
#:package Vapolia.SegmentedViews@1.0.8
#addin nuget:?package=Vapolia.SegmentedViews&version=1.0.8
#tool nuget:?package=Vapolia.SegmentedViews&version=1.0.8
Vapolia.SegmentedViews
dotnet add package Vapolia.SegmentedViews
builder.UseSegmentedView();
Platforms:
- Android API 27+
- iOS 15+
- MacOS 14.0+
- Windows 10.0.19041.0+
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" />
IsSelectionRequired feature
By default, the control requires a selected item. By setting IsSelectionRequired
to False
, it won't try to constraint the SelectedIndex between 0 and the number of segments. The visual result is no segment is selected.
TLDR: set IsSelectionRequired="False"
and SelectedIndex="-1"
to visually see no selection.
Highlight color on Android
This is standard Material design on the native Android platform. Check the native doc for more info.
For quick ref:
FAQ
(1) Cannot resolve type "https://vapolia.eu/Vapolia.SegmentedViews:segmented:Segment"
Make sure your SupportedOSPlatformVersion is at least those:
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">13.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">27.0</SupportedOSPlatformVersion>
(2) Cannot resolve type "https://vapolia.eu/Vapolia.SegmentedViews:segmented:Segment"
replace xmlns:segmented="https://vapolia.eu/Vapolia.SegmentedViews"
by
xmlns:segmented="clr-namespace:Vapolia.SegmentedViews;assembly=Vapolia.SegmentedViews"
Windows
On windows, this control uses CommunityToolkit.WinUI.Controls.Segmented
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-android35.0 is compatible. net9.0-browser was computed. net9.0-ios was computed. net9.0-ios18.0 is compatible. net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 is compatible. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net9.0-windows10.0.19041 is compatible. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Maui.Controls (>= 9.0.90)
-
net9.0-android35.0
- Microsoft.Maui.Controls (>= 9.0.90)
-
net9.0-ios18.0
- Microsoft.Maui.Controls (>= 9.0.90)
-
net9.0-maccatalyst18.0
- Microsoft.Maui.Controls (>= 9.0.90)
-
net9.0-windows10.0.19041
- CommunityToolkit.WinUI.Controls.Segmented (>= 8.2.250402)
- Microsoft.Maui.Controls (>= 9.0.90)
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.9-ci16704833904 | 0 | 8/3/2025 |
1.0.9-ci16704251801 | 0 | 8/3/2025 |
1.0.9-ci16704034409 | 0 | 8/3/2025 |
1.0.8 | 1 | 8/3/2025 |
1.0.7 | 9 | 8/3/2025 |
1.0.6 | 655 | 8/27/2024 |
1.0.5 | 160 | 8/15/2024 |
1.0.4 | 433 | 4/15/2024 |
1.0.3 | 155 | 3/31/2024 |
1.0.2 | 152 | 3/16/2024 |
1.0.1 | 153 | 3/14/2024 |
1.0.0 | 168 | 3/5/2024 |
1.0.0-ci8141352883 | 129 | 3/4/2024 |
1.0.0-ci8139282302 | 105 | 3/4/2024 |
1.0.0-ci8113045545 | 127 | 3/1/2024 |
1.0.0-ci8016228389 | 127 | 2/23/2024 |
1.0.0-ci16703913250 | 0 | 8/3/2025 |
1.0.8: fix typo in Segment which prevented the Width property to work for Segments.
1.0.7: net9.0 and Windows
1.0.6: upgrade nugets.
1.0.5: Upgrade nugets.
1.0.3: add net8.0 target for unit tests
1.0.1: Upgrade nugets. Remove dependency on maui compatibility.
1.0.0: Initial release