menu

MAUI Toolkit

  • User Guide
  • Demos
  • Support
Class PickerHeaderView - MAUI-ToolKit API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PickerHeaderView

    Represents a class which is used to customize all the properties of header view of the picker.

    Inheritance
    System.Object
    PickerHeaderView
    Namespace: Syncfusion.Maui.Toolkit.Picker
    Assembly: Syncfusion.Maui.Toolkit.dll
    Syntax
    public class PickerHeaderView : Element

    Constructors

    PickerHeaderView()

    Initializes a new instance of the PickerHeaderView class.

    Declaration
    public PickerHeaderView()

    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.

    DividerColorProperty

    Identifies the DividerColor dependency property.

    Declaration
    public static readonly BindableProperty DividerColorProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for DividerColor dependency property.

    HeightProperty

    Identifies the Height dependency property.

    Declaration
    public static readonly BindableProperty HeightProperty
    Field Value
    Type Description
    Microsoft.Maui.Controls.BindableProperty

    The identifier for Height 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.

    Properties

    Background

    Gets or sets the background of the header view in picker.

    Declaration
    public Brush Background { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Controls.Brush

    The default value of Background is Brush.Transparent.

    Examples

    The following example demonstrates how to set the background of the header view.

    • XAML
    • C#
    <picker:SfPicker>
        <picker:SfPicker.HeaderView>
            <picker:PickerHeaderView Background="Blue" />
        </picker:SfPicker.HeaderView>
    </picker:SfPicker>
    SfPicker picker = new SfPicker();
    picker.HeaderView = new PickerHeaderView
    {
        Background = Brush.Blue
    };

    DividerColor

    Gets or sets the color of the header separator line in picker.

    Declaration
    public Color DividerColor { get; set; }
    Property Value
    Type Description
    Microsoft.Maui.Graphics.Color

    The default value of DividerColor is "#CAC4D0".

    Examples

    The following example demonstrates how to set the divider color of the header view.

    • XAML
    • C#
    <picker:SfPicker>
        <picker:SfPicker.HeaderView>
            <picker:PickerHeaderView DividerColor="Gray" />
        </picker:SfPicker.HeaderView>
    </picker:SfPicker>
    SfPicker picker = new SfPicker();
    picker.HeaderView = new PickerHeaderView
    {
        DividerColor = Colors.Gray
    };

    Height

    Gets or sets the value to specify the height of header view on picker.

    Declaration
    public double Height { get; set; }
    Property Value
    Type Description
    System.Double

    The default value of Height is 0d.

    Examples

    The following example demonstrates how to set the height of the header view.

    • XAML
    • C#
    <picker:SfPicker>
        <picker:SfPicker.HeaderView>
            <picker:PickerHeaderView Height="50" />
        </picker:SfPicker.HeaderView>
    </picker:SfPicker>
    SfPicker picker = new SfPicker();
    picker.HeaderView = new PickerHeaderView
    {
        Height = 50
    };

    Text

    Gets or sets the value to specify the text of header view on picker.

    Declaration
    public string Text { get; set; }
    Property Value
    Type Description
    System.String

    The default value of Text is string.Empty.

    Examples

    The following example demonstrates how to set the text of the header view.

    • XAML
    • C#
    <picker:SfPicker>
        <picker:SfPicker.HeaderView>
            <picker:PickerHeaderView Text="Select an item" />
        </picker:SfPicker.HeaderView>
    </picker:SfPicker>
    SfPicker picker = new SfPicker();
    picker.HeaderView = new PickerHeaderView
    {
        Text = "Select an item"
    };

    TextStyle

    Gets or sets the text style of the header text in picker.

    Declaration
    public PickerTextStyle TextStyle { get; set; }
    Property Value
    Type
    PickerTextStyle
    Examples

    The following example demonstrates how to set the text style of the header view.

    • XAML
    • C#
    <picker:SfPicker>
        <picker:SfPicker.HeaderView>
            <picker:PickerHeaderView>
                <picker:PickerHeaderView.TextStyle>
                    <picker:PickerTextStyle TextColor="Blue" FontSize="16" />
                </picker:PickerHeaderView.TextStyle>
            </picker:PickerHeaderView>
        </picker:SfPicker.HeaderView>
    </picker:SfPicker>
    SfPicker picker = new SfPicker();
    picker.HeaderView = new PickerHeaderView
    {
        TextStyle = new PickerTextStyle
        {
            TextColor = Colors.Blue,
            FontSize = 16
        }
    };
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved