-
-
Notifications
You must be signed in to change notification settings - Fork 39
Converters
Marvin E edited this page Dec 25, 2025
·
10 revisions
Truncates the end of the binded string until its length is equal to the int specified in the ConverterParameter. Useful for displaying days of the week.
Cannot convert back.
In this example (Xamarin Forms):
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XCalendarSample.Views.MainPage"
xmlns:xcConverters="clr-namespace:XCalendar.Converters;assembly=XCalendar">
<ContentPage.Resources>
<xcConverters:StringCharLimitConverter x:Key="StringCharLimitConverter"/>
</ContentPage.Resources>
<Label Text="{Binding MyString, Converter={StaticResource StringCharLimitConverter}, ConverterParameter=3}"/>
</ContentPage>- "Monday" would give "Mon"
- "Tuesday" would give "Tue"
- "Wednesday" would give "Wed"
- "Thu" would give "Thu"
- "Fr" would give "Fr"
Determines if the binded value is null or empty.
Returns true if the binded value is null or empty, otherwise, false.
Cannot convert back.
Localises a DayOfWeek and truncates the result to the specified length.