Skip to content

Commit 6f78215

Browse files
Added UG content for the ShowSeparator property in the MAUI SegmentedControl.
1 parent c381529 commit 6f78215

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

MAUI/Segmented-Control/customization.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,56 @@ public partial class MainPage : ContentPage
352352

353353
![Segment item background customization in .NET MAUI Segmented control.](images/customization/segment-item-background.png)
354354

355+
## Separator Visibility
356+
357+
The [ShowSeparator](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentedControl.html#Syncfusion_Maui_Buttons_SfSegmentedControl_ShowSeparator) property is used to control the visibility of the separator line that appears between the segments in the [SfSegmentedControl](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentedControl.html?tabs=tabid-34%2Ctabid-30%2Ctabid-19%2Ctabid-16%2Ctabid-37%2Ctabid-3%2Ctabid-24%2Ctabid-32%2Ctabid-8%2Ctabid-36%2Ctabid-10%2Ctabid-6%2Ctabid-14%2Ctabid-26%2Ctabid-28%2Ctabid-22%2Ctabid-12%2Ctabid-1). By default, the separator is visible, and setting this property to false hides the separator line.
358+
359+
{% tabs %}
360+
{% highlight XAML hl_lines="2" %}
361+
362+
<ContentPage xmlns:buttons="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons">
363+
<buttons:SfSegmentedControl x:Name="segmentedControl" ShowSeparator="False">
364+
<buttons:SfSegmentedControl.ItemsSource>
365+
<x:Array Type="{x:Type x:String}">
366+
<x:String>Day</x:String>
367+
<x:String>Week</x:String>
368+
<x:String>Month</x:String>
369+
<x:String>Year</x:String>
370+
</x:Array>
371+
</buttons:SfSegmentedControl.ItemsSource>
372+
</buttons:SfSegmentedControl>
373+
</ContentPage>
374+
375+
{% endhighlight %}
376+
{% highlight C# hl_lines="18" %}
377+
378+
using Syncfusion.Maui.Buttons;
379+
. . .
380+
381+
public partial class MainPage : ContentPage
382+
{
383+
public MainPage()
384+
{
385+
InitializeComponent();
386+
SfSegmentedControl segmentedControl = new SfSegmentedControl();
387+
List<SfSegmentItem> itemList = new List<SfSegmentItem>
388+
{
389+
new SfSegmentItem() {Text = "Day"},
390+
new SfSegmentItem() {Text = "Week"},
391+
new SfSegmentItem() {Text = "Month"},
392+
new SfSegmentItem() {Text = "Year"},
393+
};
394+
segmentedControl.ItemsSource = itemList;
395+
segmentedControl.ShowSeparator = false;
396+
this.Content = segmentedControl;
397+
}
398+
}
399+
400+
{% endhighlight %}
401+
{% endtabs %}
402+
403+
![Hide Seperator line in .NET MAUI Segmented control.](images/customization/segmented-control-show-separator.png)
404+
355405
## Customize segment items appearance using DataTemplate
356406

357407
Use the [SegmentTemplate](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentedControl.html#Syncfusion_Maui_Buttons_SfSegmentedControl_SegmentTemplate) property of [SfSegmentedControl](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentedControl.html) to create custom segmented control. The following example code shows how to create a custom segmented control using a data template.
6.41 KB
Loading

0 commit comments

Comments
 (0)