Class ThemeBindings
Helper methods for using theme bindings in code-behind
public static class ThemeBindings
- Inheritance
-
ThemeBindings
- Inherited Members
Methods
GetThemeValue<T>(T, T, T)
Gets the current theme value without creating a binding
public static T GetThemeValue<T>(T lightValue, T darkValue, T defaultValue = default)
Parameters
lightValueTdarkValueTdefaultValueT
Returns
- T
Type Parameters
T
SetThemeBinding(BindableObject, BindableProperty, object, object, object)
Sets up a theme binding in code-behind
public static ThemeBinding SetThemeBinding(BindableObject target, BindableProperty property, object lightValue, object darkValue, object defaultValue = null)
Parameters
targetBindableObjectpropertyBindablePropertylightValueobjectdarkValueobjectdefaultValueobject
Returns
WithThemeBinding<TControl>(TControl, BindableProperty, object, object, object)
Fluent extension method for setting theme bindings
public static TControl WithThemeBinding<TControl>(this TControl control, BindableProperty property, object lightValue, object darkValue, object defaultValue = null) where TControl : BindableObject
Parameters
controlTControlpropertyBindablePropertylightValueobjectdarkValueobjectdefaultValueobject
Returns
- TControl
Type Parameters
TControl