Difference between revisions of "Converters In Xamarin"
Line 43: | Line 43: | ||
| EqualityToBoolConverter || style="text-align: center;" | ✗ || Returns ''true'' if the given value and parameter are '''equal to each other''', ''false'' otherwise. | | EqualityToBoolConverter || style="text-align: center;" | ✗ || Returns ''true'' if the given value and parameter are '''equal to each other''', ''false'' otherwise. | ||
|- | |- | ||
− | | EqualityToInvertedBoolConverter|| style="text-align: center;" | ✗ || Returns ''true'' if the given value and parameter are '''not equal to each other''', ''false'' otherwise. | + | | EqualityToInvertedBoolConverter || style="text-align: center;" | ✗ || Returns ''true'' if the given value and parameter are '''not equal to each other''', ''false'' otherwise. |
+ | |- | ||
+ | | SelectionChangedEventArgsConverter || style="text-align: center;" | ✗ || Converts an '''[https://help.syncfusion.com/cr/cref_files/xamarin/Syncfusion.SfListView.XForms~Syncfusion.ListView.XForms.ItemSelectionChangedEventArgs.html Syncfusion ItemSelectionChangedEventArgs]''' to a '''[https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.selectionchangedeventargs ListSelectionChangedEventArgs]'''. The use-case of this converter is highly specific. | ||
+ | |- | ||
+ | | FilterCriterionToValueConverter || style="text-align: center;" | ✓ || Converts a '''FilterCriterion''' to its value. The functionality is similar to UWP's FilterCriterionToValueConverter. | ||
+ | |- | ||
+ | | GuidPropertyValueConverter || style="text-align: center;" | ✓ || Returns the '''first item''' of the parameter's ''Source-ViewModel'' that '''matches the given GUID''' value. If none is found, ''null'' is returned. | ||
+ | |- | ||
+ | | IntToColorConverter || style="text-align: center;" | ✗ || Converts an '''integer''' value to a '''color'''. If the value cannot be interpreted, the converter tries to parse the parameter as a ''color'' to return it. If everything fails, ''transparent'' is returned. | ||
|} | |} | ||
===Usage=== | ===Usage=== | ||
<Shortly describe how to use the activity ...> | <Shortly describe how to use the activity ...> |
Revision as of 14:21, 1 August 2019
Converters in Xamarin
This page lists all currently available converters for customizing Xamarin XAML. This Page is WIP!!!
Converter | 2-Way | Description |
---|---|---|
BooleanConverter | ✓ | Interprets the boolean value and returns it. If the value cannot be interpreted, false is returned. |
BooleanInvertConverter | ✓ | Interprets and converts a boolean into its inverted value. If the value cannot be interpreted, false is returned. |
BooleanToFontAttributeConverter | ✗ | Converts a boolean into a [font attribute] value. In detail, if the value is true, the parameter is interpreted (Bold, Italic, None) and returned. The default returned font-attribute is None. |
ByteToImageSourceValueConverter | ✗ | Converts a byte stream value into an image source. |
ChildAreaTemplateConverter | ✗ | Returns a ChildAreaTemplate from a ContentViewModel or null if the ViewModel cannot be interpreted. |
ChildItemSelectionModeToSfListViewSelectionModeConverter | ✓ | Converts a ChildItemSelectionMode to [Syncfusion's ListViewSelectionMode]. Default is "Single". |
ClassificationToBoolConverter | ✗ | Returns a boolean indicating whether the given ContentViewModel is successfully classified. |
ContainsToBoolConverter | ✗ | Checks if the delivered value is contained within a collection of values (delivered in the parameter, seperated with |). If the value is contained, true will be returned, else false. The functionality is similar to the ContainsToVisibilityConverter in the WinX project. |
ContainsToInvertedBoolConverter | ✗ | Same as the ContainsToBoolConverter, but with inverted output. The functionality is similar to the ContainsToVisibilityConverter in the WinX project. |
ContentAreaTeamplateConverter | ✗ | This converter is not yet finished and just returns the UBIKContentArea if the value is a ContentViewModel. |
DateTimeOffsetToDateConverter | ✓ | Converts a DateTimeOffset to the correct DateTime. If the value cannot be interpreted, a new DateTime, generated from the device's current time (DateTime.Now) is returned. |
DateTimeToFromNowStringConverter | ✗ | Returns a DateTime into a human-readable and easily understandable string message (the last applying one will be taken):
|
DebugConverter | ✓ | A converter returning the given value for debug reasons. |
DistanceToStringConverter | ✗ | Returns the given value interpreted as length. Values are returned in kilometers with two comma digits (e.g. 2.84km), values smaller than 1km are returned as meters and NaN will be returned as infinity. If the value cannot be interpreted, an empty string will be returned. |
EqualityToBoolConverter | ✗ | Returns true if the given value and parameter are equal to each other, false otherwise. |
EqualityToInvertedBoolConverter | ✗ | Returns true if the given value and parameter are not equal to each other, false otherwise. |
SelectionChangedEventArgsConverter | ✗ | Converts an Syncfusion ItemSelectionChangedEventArgs to a ListSelectionChangedEventArgs. The use-case of this converter is highly specific. |
FilterCriterionToValueConverter | ✓ | Converts a FilterCriterion to its value. The functionality is similar to UWP's FilterCriterionToValueConverter. |
GuidPropertyValueConverter | ✓ | Returns the first item of the parameter's Source-ViewModel that matches the given GUID value. If none is found, null is returned. |
IntToColorConverter | ✗ | Converts an integer value to a color. If the value cannot be interpreted, the converter tries to parse the parameter as a color to return it. If everything fails, transparent is returned. |
Usage
<Shortly describe how to use the activity ...>