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
.
Property | Android | iOS | Notes |
---|---|---|---|
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
.
Property | Android | iOS | Notes |
---|---|---|---|
BorderWidth | ✔ | ✔ | |
BorderColor | ✔ | ✔ | |
BorderCornerRadius | ✔ | ✔ | float |
BorderStyle | ✔ | ✔ | Default, None, BottomLine, Rect, RoundRect |
Editor
Attached properties for Editor
are declared in class UXDivers.Grial.EditorProperties
.
Property | Android | iOS | Notes |
---|---|---|---|
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
.
Property | Android | iOS | Notes |
---|---|---|---|
TintColor | ✔ | ✘ | Slider left side color |
ProgressBar
Attached properties for ProgressBar
are declared in class UXDivers.Grial.ProgressBarProperties
.
Property | Android | iOS | Notes |
---|---|---|---|
TintColor | ✔ | ✘ | Progress color |
Switch
Attached properties for Switch
are declared in class UXDivers.Grial.SwitchProperties
.
Property | Android | iOS | Notes |
---|---|---|---|
TintColor | ✔ | ✘ | On color |
TableView
Attached properties for TableView
are declared in class UXDivers.Grial.TableViewProperties
.
Property | Android | iOS | Notes |
---|---|---|---|
HeaderFooterTextColor | ✔ | ✔ | Color on header and footer |
SearchBar
Attached properties for SearchBar
are declared in class UXDivers.Grial.SearchBarProperties
.
Property | Android | iOS | Notes |
---|---|---|---|
FieldBackgroundColor | ✘ | ✔ | Inner background field color |
IconColor | API >= 21 | ✔ | Glass icon color |
BorderColor | API >= 21 | ✔ | |
BorderWidth | ✘ | ✔ | float |