Skip to content

Commit 0a66b31

Browse files
Merge pull request #3544 from syncfusion-content/ShowSeparatorSegmentedControlHotfix
UG for ShowSeparator property in the MAUI SegmentedControl - Hotfix
2 parents dd69daa + 0215aed commit 0a66b31

File tree

2 files changed

+55
-5
lines changed

2 files changed

+55
-5
lines changed

MAUI/Segmented-Control/customization.md

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
layout: post
3-
title: Appearance Customization of .NET MAUI Segmented Control (SfSegmentedControl) | Syncfusion<sup>&reg;</sup>
4-
description: Learn about the appearance customization of Syncfusion<sup>&reg;</sup> .NET MAUI Segmented Control (SfSegmentedControl).
3+
title: Appearance Customization of .NET MAUI SfSegmentedControl | Syncfusion®
4+
description: Learn about the appearance customization of Syncfusion® .NET MAUI Segmented Control (SfSegmentedControl).
55
platform: maui
66
control: Segmented (SfSegmented) control
77
documentation: ug
88
---
99

10-
# Appearance Customization of .NET MAUI Segmented Control (SfSegmentedControl)
10+
# Appearance Customization of .NET MAUI SfSegmentedControl
1111
The .NET MAUI Segmented control allows you to customize the background, text color, selection style, and more.
1212

1313
## Customize the border color
@@ -245,7 +245,7 @@ public partial class MainPage : ContentPage
245245
Customize the text style of each segment item using the [TextStyle](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentItem.html#Syncfusion_Maui_Buttons_SfSegmentItem_TextStyle) property of [SfSegmentItem](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentItem.html).
246246

247247
{% tabs %}
248-
{% highlight C# tabtitle="MainPage.xaml.cs"%}
248+
{% highlight C# tabtitle="MainPage.xaml.cs" %}
249249

250250
using Syncfusion.Maui.Buttons;
251251
. . .
@@ -324,7 +324,7 @@ public partial class MainPage : ContentPage
324324
Customize the background of each segment item using the [Background](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentItem.html#Syncfusion_Maui_Buttons_SfSegmentItem_Background) property of [SfSegmentItem](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Buttons.SfSegmentItem.html).
325325

326326
{% tabs %}
327-
{% highlight C# tabtitle="MainPage.xaml.cs"%}
327+
{% highlight C# tabtitle="MainPage.xaml.cs" %}
328328

329329
using Syncfusion.Maui.Buttons;
330330
. . .
@@ -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 Change to Show or Hide Separator
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)