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✔✔
BorderCornerRadius✔✔float
BorderStyle✔✔Default, None, BottomLine, Rect, RoundRect
HorizontalTextAlignment✔✔Start, Center, End

Entry​

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

PropertyAndroidiOSNotes
BorderWidth✔✔
BorderColor✔✔
BorderCornerRadius✔✔float
BorderStyle✔✔Default, None, BottomLine, Rect, RoundRect

Editor​

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

PropertyAndroidiOSNotes
Placeholder✔✔Watermark text
PlaceholderColor✔✔Watermark text color
BorderWidth✔✔
BorderColor✔✔
BorderCornerRadius✔✔float
BorderStyle✔✔Default, None, BottomLine, Rect, RoundRect

Slider​

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

PropertyAndroidiOSNotes
TintColor✔✘Slider left side color

ProgressBar​

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

PropertyAndroidiOSNotes
TintColor✔✘Progress color

Switch​

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

PropertyAndroidiOSNotes
TintColor✔✘On color

TableView​

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

PropertyAndroidiOSNotes
HeaderFooterTextColor✔✔Color on header and footer

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

PropertyAndroidiOSNotes
FieldBackgroundColor✘✔Inner background field color
IconColorAPI >= 21✔Glass icon color
BorderColorAPI >= 21✔
BorderWidth✘✔float