Skip to content

Instantly share code, notes, and snippets.

@FreakyAli
Last active November 9, 2023 03:29
Show Gist options
  • Save FreakyAli/89f036db2ed4e4ac13d4300e4a67159e to your computer and use it in GitHub Desktop.
Save FreakyAli/89f036db2ed4e4ac13d4300e4a67159e to your computer and use it in GitHub Desktop.
Compiled binding example
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="Samples.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:samples="clr-namespace:Samples"
x:DataType="samples:MainViewModel">
<ListView
CachingStrategy="RecycleElementAndDataTemplate"
ItemTapped="ListView_ItemTapped"
ItemsSource="{Binding Items}"
SelectionMode="None"
SeparatorVisibility="None">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding .}" TextColor="Black" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment