Udara.Plugin.XFSegmentedControl 1.0.2

Segmented Button Control for Xamarin.Forms (Android, iOS, UWP) with awesome features, such as dynamically adding or removing Tab Button elements, setting Colors, and Selected Index at run time with full native look and feel. Built from pure Xamarin.Forms, lightweight, no custom renders nor platform implementations, and it's awesome! ;)

Install-Package Udara.Plugin.XFSegmentedControl -Version 1.0.2
dotnet add package Udara.Plugin.XFSegmentedControl --version 1.0.2
<PackageReference Include="Udara.Plugin.XFSegmentedControl" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Udara.Plugin.XFSegmentedControl --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

How to?

Just install in your Xamarin.Forms PCL/Dot Net Standard project, you're good go! (no need to install in the platform projects) because it's that awesome and lightweight! :D

XAML Set up

xmlns:xfsegmentedcontrol="clr-namespace:Udara.Plugin.XFSegmentedControl;assembly=Udara.Plugin.XFSegmentedControl"
<xfsegmentedcontrol:SegmentedControl
	x:Name="SegmentedControl1"
	PrimaryColor="White"
	SecondaryColor="Black"
	SelectedTabIndex="2"
	SelectedTabIndexChanged="SegmentedControl1_SelectedTabIndexChanged">
	<xfsegmentedcontrol:SegmentedControl.TabButtonsSource>
		<x:Array Type="{x:Type x:String}">
			<x:String>Tab 1</x:String>
			<x:String>Tab 2</x:String>
			<x:String>Tab 3</x:String>
			<x:String>Tab 4</x:String>
		</x:Array>
	</xfsegmentedcontrol:SegmentedControl.TabButtonsSource>
</xfsegmentedcontrol:SegmentedControl>

SelectedTabIndexChanged Event

private void SegmentedControl1_SelectedTabIndexChanged
		(object sender, SelectedTabIndexEventArgs e)
{
	Label1.Text 
		= $"Currently selected - Tab {e.SelectedTabIndex + 1}";
}

Bindable Properties

TabButtonsSource: Gets or sets Item Source of Tabs, type of IEnumerable<string>

SelectedTabIndex: Gets or sets the current selected Tab/Button/Segment index, type of int

PrimaryColor: Gets or sets the Primary color of the element, type of Color

SecondaryColor: Gets or sets the Secondary color of the element, type of Color

Event Handler / Command

Fires when the selected Tab/Button/Segment is changed

SelectedTabIndexChanged: Gets SelectedTabIndexEventArgs contains updated index, SelectedTabIndex, type of int

SelectedTabIndexChangedCommand: Gets the updated index as a param, type of int

How to?

Just install in your Xamarin.Forms PCL/Dot Net Standard project, you're good go! (no need to install in the platform projects) because it's that awesome and lightweight! :D

XAML Set up

xmlns:xfsegmentedcontrol="clr-namespace:Udara.Plugin.XFSegmentedControl;assembly=Udara.Plugin.XFSegmentedControl"
<xfsegmentedcontrol:SegmentedControl
	x:Name="SegmentedControl1"
	PrimaryColor="White"
	SecondaryColor="Black"
	SelectedTabIndex="2"
	SelectedTabIndexChanged="SegmentedControl1_SelectedTabIndexChanged">
	<xfsegmentedcontrol:SegmentedControl.TabButtonsSource>
		<x:Array Type="{x:Type x:String}">
			<x:String>Tab 1</x:String>
			<x:String>Tab 2</x:String>
			<x:String>Tab 3</x:String>
			<x:String>Tab 4</x:String>
		</x:Array>
	</xfsegmentedcontrol:SegmentedControl.TabButtonsSource>
</xfsegmentedcontrol:SegmentedControl>

SelectedTabIndexChanged Event

private void SegmentedControl1_SelectedTabIndexChanged
		(object sender, SelectedTabIndexEventArgs e)
{
	Label1.Text 
		= $"Currently selected - Tab {e.SelectedTabIndex + 1}";
}

Bindable Properties

TabButtonsSource: Gets or sets Item Source of Tabs, type of IEnumerable<string>

SelectedTabIndex: Gets or sets the current selected Tab/Button/Segment index, type of int

PrimaryColor: Gets or sets the Primary color of the element, type of Color

SecondaryColor: Gets or sets the Secondary color of the element, type of Color

Event Handler / Command

Fires when the selected Tab/Button/Segment is changed

SelectedTabIndexChanged: Gets SelectedTabIndexEventArgs contains updated index, SelectedTabIndex, type of int

SelectedTabIndexChangedCommand: Gets the updated index as a param, type of int

Release Notes

[1.0.0]
All good with support for Android, iOS, UWP
[1.0.1]
Fix a bug in UWP
[1.0.1]
Fix a tiny bug in Android

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.2 754 8/11/2018
1.0.1 170 8/10/2018
1.0.0 177 8/9/2018