Skip to content

Latest commit

 

History

History
559 lines (309 loc) · 15.3 KB

File metadata and controls

559 lines (309 loc) · 15.3 KB

MaterialSlider

Sliders let users make selections from a range of values and follow Material Design Guidelines. See more.

Namespace: HorusStudio.Maui.MaterialDesignControls

Inherits from: MaterialSlider → ContentView


XAML sample

xmlns:material="clr-namespace:HorusStudio.Maui.MaterialDesignControls;assembly=HorusStudio.Maui.MaterialDesignControls"

 <material:MaterialSlider 
                     Label="Only label"
                       Value="{Binding Value}"
                    BackgroundColor="{x:Static material:MaterialLightTheme.SurfaceContainer}" />

C# sample

var slider = new MaterialSlider
{
   Label = "slider"
};

See more example

Properties

Gets or sets the color for the active track. This is a bindable property.

Property type: Color

Default value: Light: MaterialLightTheme.Primary - Dark: MaterialDarkTheme.Primary


Gets or sets a value that allows the automation framework to find and interact with this element.

Property type: String

Remarks: This value may only be set once on an element.

When set on this control, the AutomationId is also used as a base identifier for its internal elements:

  • The Slider control uses the same AutomationId value.
  • The label uses the identifier "{AutomationId}_Label".

This convention allows automated tests and accessibility tools to consistently locate all subelements of the control.


This property is mandatory to set if you want a proper design. Allows you to set the color of the thumb shadow. You should set it equal to the background color of the slider's container.

Property type: Color


Gets or sets the spacing between characters of the label. This is a bindable property.

Property type: Double

Default value: MaterialFontTracking.BodyMedium


Gets or sets the command executed at the end of a drag action. This is a bindable property.

Property type: ICommand


Gets or sets the command executed at the beginning of a drag action. This is a bindable property.

Property type: ICommand


Gets or sets a value that indicates whether the font for the text of this button is bold, italic, or neither. This is a bindable property.

Property type: FontAttributes


Defines whether an app's UI reflects text scaling preferences set in the operating system. The default value of this property is true.

Property type: Boolean

Default value: True

Remarks: Typically this should always be enabled for accessibility reasons.


Gets or sets the font family for the label. This is a bindable property.

Property type: String


Defines the font size of the label. This is a bindable property.

Property type: Double


Gets or sets the color for the inactive track. This is a bindable property.

Property type: Color


Internal implementation of the Slider control.

Property type: Slider

Remarks: This property can affect the internal behavior of this control. Use only if you fully understand the potential impact.


Gets or sets if slider is enabled. This is a bindable property.

Property type: Boolean

Default value: true


Gets or sets the text for the label. This is a bindable property.

Property type: String


Gets or sets the color for the text of the label. This is a bindable property.

Property type: Color

Default value: Light: MaterialLightTheme.Text - Dark: MaterialDarkTheme.Text


Defines the casing of the label. This is a bindable property.

Property type: TextTransform


Defines the maximum value of the slider. This is a bindable property.

Property type: Double

Default value: 1


Gets or sets the spacing between characters of the maximum label. This is a bindable property.

Property type: Double


Gets or sets the text style of the maximum label. This is a bindable property.

Property type: FontAttributes


Defines whether an app's UI reflects text scaling preferences set in the operating system. The default value of this property is true.

Property type: Boolean

Default value: true


Gets or sets the font family for the maximum label. This is a bindable property.

Property type: String


Defines the font size of the maximum label. This is a bindable property.

Property type: Double


Allows you to display a bitmap image instead of a label on the maximum side. This is a bindable property.

Property type: ImageSource


Gets or sets the text for the maximum label. This is a bindable property.

Property type: String


Gets or sets the color for the text of the maximum label. This is a bindable property.

Property type: Color


Defines the casing of the maximum label. This is a bindable property.

Property type: TextTransform


Defines the minimum value of the slider. This is a bindable property.

Property type: Double

Default value: 0


Gets or sets the spacing between characters of the minimum label. This is a bindable property.

Property type: Double

Default value: MaterialFontTracking.BodyMedium


Gets or sets the text style of the minimum label. This is a bindable property.

Property type: FontAttributes


Defines whether an app's UI reflects text scaling preferences set in the operating system. This is a bindable property.

Property type: Boolean

Default value: true

Remarks: Typically this should always be enabled for accessibility reasons.


Gets or sets the font family for the minimum label. This is a bindable property.

Property type: String


Defines the font size of the minimum label. This is a bindable property.

Property type: Double


Allows you to display a bitmap image instead of a label on the minimum side. This is a bindable property.

Property type: ImageSource


Gets or sets the text for the minimum label. This is a bindable property.

Property type: String


Gets or sets the color for the text of the minimum label. This is a bindable property.

Property type: Color

Default value: Light: MaterialLightTheme.Text - Dark: MaterialDarkTheme.Text


Defines the casing of the minimum label. This is a bindable property.

Property type: TextTransform


Gets or sets if icons are shown. This is a bindable property. This property is used to show the icons even when the minimum/maximum label is set.

Property type: Boolean

Default value: false


Defines whether to show the value indicator.

Property type: Boolean


Gets or sets the thumb color. This is a bindable property.

Property type: Color

Default value: Light: MaterialLightTheme.Primary - Dark: MaterialDarkTheme.Primary


Allows you to set the thumb height.

Property type: Int32

Default value: 44


Allows you to display an image on thumb. This is a bindable property. As a recommendation, on iOS you should set the thumb background color.

Property type: ImageSource

Remarks: For more options, see ImageButton.


Allows you to set the thumb width.

Property type: Int32

Default value: 4


Gets or sets the track corner radius for the slider control. This is a bindable property.

Property type: Int32


Gets or sets the track height for the slider control. This is a bindable property.

Property type: Int32


Gets or sets the track image for the slider control. This is a bindable property.

Property type: ImageSource


Gets or sets if user interactions are enabled. This is a bindable property.

Property type: Boolean

Default value: true


Defines the value of the slider. This is a bindable property.

Property type: Double

Default value: 0


Gets or sets the command executed when value changed. This is a bindable property.

Property type: ICommand


Sets the background color of the value indicator.

Property type: Color


Sets the value indicator's font size.

Property type: Double


Sets the value indicator's format. This uses the format from string.Format(string, object?) to show the value in the specified format.

Property type: String

Default value: {0:0.00}


Allows you to set the value indicator size.

Property type: Int32

Default value: 44


Sets the text color of the value indicator.

Property type: Color