zhaw-dnet2/Tasks/Lab12/TodoDetails/MainPage.xaml

48 lines
2.3 KiB
XML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:model="clr-namespace:TodoDetails.Model"
x:Class="TodoDetails.MainPage">
<ScrollView>
<CollectionView>
<CollectionView.ItemsSource>
<x:Array Type="{x:Type model:Todo}">
<model:Todo Title="Create ViewModel"
Description="Create a ViewModel in the next step to learn MVVM."
Category="Default"
IsDone="False"/>
<model:Todo Title="Add Theming"
Description="Integrate your own theme in the app."
Category="Default"
IsDone="False"/>
<model:Todo Title="Add local database"
Description="Learn how to add a local database to work with (optional)."
Category="Default"
IsDone="False"/>
</x:Array>
</CollectionView.ItemsSource>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="model:Todo">
<HorizontalStackLayout Padding="10"
Spacing="10"
HorizontalOptions="FillAndExpand">
<CheckBox IsChecked="{Binding IsDone}"
VerticalOptions="Start"/>
<VerticalStackLayout VerticalOptions="Center">
<Label Text="{Binding Title}"
VerticalOptions="Center"
FontSize="16"
TextColor="Gray"/>
<Label Text="{Binding Category}"
FontSize="12"
TextColor="Gray"/>
</VerticalStackLayout>
</HorizontalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</ContentPage>