Class SfSegmentItem
Represents an individual item used in a segmented control.
Inheritance
Namespace: Syncfusion.Maui.Toolkit.SegmentedControl
Assembly: Syncfusion.Maui.Toolkit.dll
Syntax
public class SfSegmentItem : Element
  Constructors
SfSegmentItem()
Declaration
public SfSegmentItem()
  Fields
BackgroundProperty
Identifies the Background dependency property.
Declaration
public static readonly BindableProperty BackgroundProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for Background dependency property.  | 
      
ImageSizeProperty
Identifies the ImageSize dependency property.
Declaration
public static readonly BindableProperty ImageSizeProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for ImageSize dependency property.  | 
      
ImageSourceProperty
Identifies the ImageSource dependency property.
Declaration
public static readonly BindableProperty ImageSourceProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for ImageSource dependency property.  | 
      
IsEnabledProperty
Identifies the IsEnabled dependency property.
Declaration
public static readonly BindableProperty IsEnabledProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for IsEnabled dependency property.  | 
      
IsSelectedProperty
Identifies the IsSelected dependency property.
Declaration
public static readonly BindableProperty IsSelectedProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for IsSelected dependency property.  | 
      
SelectedSegmentBackgroundProperty
Identifies the SelectedSegmentBackground dependency property.
Declaration
public static readonly BindableProperty SelectedSegmentBackgroundProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for SelectedSegmentBackground dependency property.  | 
      
SelectedSegmentTextColorProperty
Identifies the SelectedSegmentTextColor dependency property.
Declaration
public static readonly BindableProperty SelectedSegmentTextColorProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for SelectedSegmentTextColor dependency property.  | 
      
TextProperty
Identifies the Text dependency property.
Declaration
public static readonly BindableProperty TextProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for Text dependency property.  | 
      
TextStyleProperty
Identifies the TextStyle dependency property.
Declaration
public static readonly BindableProperty TextStyleProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for TextStyle dependency property.  | 
      
WidthProperty
Identifies the Width dependency property.
Declaration
public static readonly BindableProperty WidthProperty
  Field Value
| Type | Description | 
|---|---|
| Microsoft.Maui.Controls.BindableProperty | The identifier for Width dependency property.  | 
      
Properties
Background
Gets or sets the background color of the segment item.
Declaration
public Brush Background { get; set; }
  Property Value
| Type | 
|---|
| Microsoft.Maui.Controls.Brush | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson", Background = Colors.Red },
          new SfSegmentItem() { Text="Gabriella", Background = Colors.Blue},
          new SfSegmentItem() { Text="Liam", Background = Colors.Green},
       };
   }
}
  
  
  
  ImageSize
Gets or sets the image size of the segment item.
Declaration
public double ImageSize { get; set; }
  Property Value
| Type | 
|---|
| System.Double | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() {  ImageSource="jackson.png", Text="Jackson", ImageSize = 40 },
          new SfSegmentItem() { ImageSource ="gabriella.png" ,Text="Gabriella", ImageSize = 30},
          new SfSegmentItem() { ImageSource="liam.png", Text="Liam", ImageSize = 40},
       };
   }
}
  
  
  
  ImageSource
Gets or sets the image displayed in the segment item.
Declaration
public ImageSource ImageSource { get; set; }
  Property Value
| Type | 
|---|
| Microsoft.Maui.Controls.ImageSource | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { ImageSource="jackson.png" },
          new SfSegmentItem() { ImageSource ="gabriella.png" },
          new SfSegmentItem() { ImageSource="liam.png" },
       };
   }
}
  
  
  
  IsEnabled
Gets or sets a value indicating whether the segment item is enabled.
Declaration
public bool IsEnabled { get; set; }
  Property Value
| Type | 
|---|
| System.Boolean | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson", IsEnabled = false },
          new SfSegmentItem() { Text="Gabriella", IsEnabled = true },
          new SfSegmentItem() { Text="Liam", IsEnabled = true },
       };
   }
}
  
  
  
  IsSelected
Gets the value indicating whether the segment item is selected.
Declaration
public bool IsSelected { get; }
  Property Value
| Type | 
|---|
| System.Boolean | 
SelectedSegmentBackground
Gets or sets the background color of the segment item when it is selected.
Declaration
public Brush SelectedSegmentBackground { get; set; }
  Property Value
| Type | 
|---|
| Microsoft.Maui.Controls.Brush | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson", SelectedSegmentBackground = Colors.LightBlue},
          new SfSegmentItem() { Text="Gabriella", SelectedSegmentBackground = Colors.LightBlue},
          new SfSegmentItem() { Text="Liam", SelectedSegmentBackground = Colors.LightBlue},
       };
   }
}
  
  
  
  SelectedSegmentTextColor
Gets or sets the text color of the segment item when it is selected.
Declaration
public Color SelectedSegmentTextColor { get; set; }
  Property Value
| Type | 
|---|
| Microsoft.Maui.Graphics.Color | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson", SelectedSegmentTextColor = Colors.LightBlue},
          new SfSegmentItem() { Text="Gabriella", SelectedSegmentTextColor = Colors.LightBlue},
          new SfSegmentItem() { Text="Liam", SelectedSegmentTextColor = Colors.LightBlue},
       };
   }
}
  
  
  
  Text
Gets or sets the text of the segment item.
Declaration
public string Text { get; set; }
  Property Value
| Type | 
|---|
| System.String | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson" },
          new SfSegmentItem() { Text="Gabriella"},
          new SfSegmentItem() { Text="Liam"},
       };
   }
}
  
  
  
  TextStyle
Gets or sets the text style of the segment item.
Declaration
public SegmentTextStyle TextStyle { get; set; }
  Property Value
| Type | 
|---|
| SegmentTextStyle | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson", TextStyle = new SegmentTextStyle(){TextColor = Colors.Green}},
          new SfSegmentItem() { Text="Gabriella", TextStyle = new SegmentTextStyle(){TextColor = Colors.Red}},
          new SfSegmentItem() { Text="Liam", TextStyle = new SegmentTextStyle(){TextColor = Colors.Yellow}},
       };
   }
}
  
  
  
  Width
Gets or sets the width of the segment item.
Declaration
public double Width { get; set; }
  Property Value
| Type | 
|---|
| System.Double | 
Examples
public class SegmentViewModel
{
   public List<SfSegmentItem> Employees { get; set; }
   public SegmentViewModel()
   {
       Employees = new List<SfSegmentItem>
       {
          new SfSegmentItem() { Text="Jackson", Width=100 },
          new SfSegmentItem() { Text="Gabriella", Width=100},
          new SfSegmentItem() { Text="Liam", Width=100},
       };
   }
}