Skip to main content

Platform Controls Extensions

Grial companion nuget package define a set of attached properties, .NET MAUI handlers and Xamarin.Forms custom renderers that extend the out-of-the-box customization options of controls.

For instance, there’s a property to define the text alignment of a Picker which is something not available in the platform.

Attached properties are defined in their own class (outside the target control type). In this case that class is UXDivers.Grial.PickerProperties and the name of the property is HorizontalTextAlignment.

Here’s an example of how to use it:

  • Xaml

Include this namespace declaration in the top of the Page / ContentView.

xmlns:grial="http://uxdivers.com/grial"

And to use the property simply do this:

<Picker grial:PickerProperties.HorizontalTextAlignment="Start" ... />
  • C#
PickerProperties.SetHorizontalTextAlignment(picker, TextAlignment.Start);

Below there’s a list of properties per control.

Picker, DatePicker, TimePicker

Attached properties for Picker, DatePicker, TimePicker are declared in class UXDivers.Grial.PickerProperties.

PropertyAndroidiOSNotes
BorderWidth
BorderColor
BorderCornerRadiusfloat
BorderStyleDefault, None, BottomLine, Rect, RoundRect
HorizontalTextAlignmentStart, Center, End

Entry

Attached properties for Entry are declared in class UXDivers.Grial.EntryProperties.

PropertyAndroidiOSNotes
BorderWidth
BorderColor
BorderCornerRadiusfloat
BorderStyleDefault, None, BottomLine, Rect, RoundRect

Editor

Attached properties for Editor are declared in class UXDivers.Grial.EditorProperties.

PropertyAndroidiOSNotes
PlaceholderWatermark text
PlaceholderColorWatermark text color
BorderWidth
BorderColor
BorderCornerRadiusfloat
BorderStyleDefault, None, BottomLine, Rect, RoundRect

Slider

Attached properties for Slider are declared in class UXDivers.Grial.SliderProperties.

PropertyAndroidiOSNotes
TintColorSlider left side color

ProgressBar

Attached properties for ProgressBar are declared in class UXDivers.Grial.ProgressBarProperties.

PropertyAndroidiOSNotes
TintColorProgress color

Switch

Attached properties for Switch are declared in class UXDivers.Grial.SwitchProperties.

PropertyAndroidiOSNotes
TintColorOn color

TableView

Attached properties for TableView are declared in class UXDivers.Grial.TableViewProperties.

PropertyAndroidiOSNotes
HeaderFooterTextColorColor on header and footer

Attached properties for SearchBar are declared in class UXDivers.Grial.SearchBarProperties.

PropertyAndroidiOSNotes
FieldBackgroundColorInner background field color
IconColorAPI >= 21Glass icon color
BorderColorAPI >= 21
BorderWidthfloat