Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UI page to show our games
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:SampleValueConverters" x:Class="SampleValueConverters.SampleValueConvertersPage" xmlns:converters="clr-namespace:SampleValueConverters.ValueConverters;assembly=SampleValueConverters">
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,20,0,0" />
</OnPlatform>
</ContentPage.Padding>
<ContentPage.Resources>
<ResourceDictionary>
<converters:PlatformToColorConverter x:Key="PlatformToColorConverter"></converters:PlatformToColorConverter>
</ResourceDictionary>
</ContentPage.Resources>
<ListView ItemsSource="{Binding Games}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Name}" TextColor="{Binding GamePlatform, Converter={StaticResource PlatformToColorConverter}}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment