Skip to content

Instantly share code, notes, and snippets.

Avatar

Henning Kuntzschmann HenKun

  • TK1 GmbH
  • Germany
View GitHub Profile
@HenKun
HenKun / Readme.md
Last active Apr 25, 2019
MarkupExtension for Xamarin.Forms to have simple XAML inline converter
View Readme.md

This is a simple MarkupExtension for Xamarin.Forms that imitates an if-else-statement. It was inspired by Thomas Levesque on https://stackoverflow.com/a/841894/6884587

Usage:

  1. Include xmlns:ext="clr-namespace:Xamarin.Forms.Extensions"
  2. Use on a bindable property: <Label Text="{ext:SwitchBinding IsLoggedIn, True=Log out, False=Log in}" />

You can also add a StringFormat: