![]() |
VOOZH | about |
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" />Directory.Packages.props
<PackageReference Include="Vapolia.SegmentedViews" />Project file
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.8Install as a Cake Addin
#tool nuget:?package=Vapolia.SegmentedViews&version=1.0.8Install as a Cake Tool
👁 NuGet
👁 Nuget
👁 Publish To Nuget
dotnet add package Vapolia.SegmentedViews
builder.UseSegmentedView();
Platforms:
Supports both static segments and ItemsSource to build segments dynamically.
Add the above nuget package to your Maui project
then add this line to your maui app builder:
using Vapolia.SegmentedViews;
...
builder.UseSegmentedView();
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}" />
The width of a segment can be set in the following 3 ways, in reverse order of priority:
ItemsDefaultWidth property of SegmentedView<segmented:SegmentedView
x:Name="TheSegmentView"
SelectedIndex="0"
SelectedTextColor="White" TextColor="Black" SelectedBackgroundColor="Blue" DisabledColor="LightGray"
SelectionChangedCommand="{Binding SegmentSelectionChangedCommand}"
SelectedItem="{Binding SegmentSelectedItem}"
ItemsDefaultWidth="150" />
ItemsWidthDefinitions property of SegmentedView<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.
Width property of a Segment<segmented:Segment Item="Item1" Width="150" />
<segmented:Segment Item="Item1" Width="Auto" />
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.
This is standard Material design on the native Android platform. Check the native doc for more info.
For quick ref:
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>
replace xmlns:segmented="https://vapolia.eu/Vapolia.SegmentedViews"
by
xmlns:segmented="clr-namespace:Vapolia.SegmentedViews;assembly=Vapolia.SegmentedViews"
On windows, this control uses CommunityToolkit.WinUI.Controls.Segmented
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-android35.0 net9.0-android35.0 is compatible. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-ios18.0 net9.0-ios18.0 is compatible. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-maccatalyst18.0 net9.0-maccatalyst18.0 is compatible. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net9.0-windows10.0.19041 net9.0-windows10.0.19041 is compatible. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.9-ci16728423757 | 312 | 8/4/2025 |
| 1.0.9-ci16704833904 | 172 | 8/3/2025 |
| 1.0.9-ci16704251801 | 159 | 8/3/2025 |
| 1.0.9-ci16704034409 | 163 | 8/3/2025 |
| 1.0.8 | 285 | 8/3/2025 |
| 1.0.7 | 171 | 8/3/2025 |
| 1.0.6 | 848 | 8/27/2024 |
| 1.0.5 | 250 | 8/15/2024 |
| 1.0.4 | 570 | 4/15/2024 |
| 1.0.3 | 239 | 3/31/2024 |
| 1.0.2 | 253 | 3/16/2024 |
| 1.0.1 | 252 | 3/14/2024 |
| 1.0.0 | 265 | 3/5/2024 |
| 1.0.0-ci8141352883 | 230 | 3/4/2024 |
| 1.0.0-ci8139282302 | 196 | 3/4/2024 |
| 1.0.0-ci8113045545 | 220 | 3/1/2024 |
| 1.0.0-ci8016228389 | 229 | 2/23/2024 |
| 1.0.0-ci16703913250 | 159 | 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