46 lines
1.9 KiB
XML
46 lines
1.9 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:viewModels="clr-namespace:Jugenddienst_Stunden.ViewModels"
|
|
x:Class="Jugenddienst_Stunden.Views.AllNotesPage"
|
|
Title="Deine Notizen"
|
|
NavigatedTo="ContentPage_NavigatedTo">
|
|
|
|
<ContentPage.BindingContext>
|
|
<viewModels:NotesViewModel />
|
|
</ContentPage.BindingContext>
|
|
|
|
<!-- Add an item to the toolbar -->
|
|
<ContentPage.ToolbarItems>
|
|
<ToolbarItem Text="Add" Command="{Binding NewCommand}" IconImageSource="{FontImage Glyph='+', Color=Black, Size=22}" />
|
|
</ContentPage.ToolbarItems>
|
|
|
|
<VerticalStackLayout>
|
|
<Label Text="Werden nur lokal gespeichert"/>
|
|
|
|
<!-- Display notes in a list -->
|
|
<CollectionView x:Name="notesCollection"
|
|
ItemsSource="{Binding AllNotes}"
|
|
Margin="20"
|
|
SelectionMode="Single"
|
|
SelectionChangedCommand="{Binding SelectNoteCommand}"
|
|
SelectionChangedCommandParameter="{Binding Source={RelativeSource Self}, Path=SelectedItem}">
|
|
|
|
<!-- Designate how the collection of items are laid out -->
|
|
<CollectionView.ItemsLayout>
|
|
<LinearItemsLayout Orientation="Vertical" ItemSpacing="10" />
|
|
</CollectionView.ItemsLayout>
|
|
|
|
<!-- Define the appearance of each item in the list -->
|
|
<CollectionView.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackLayout>
|
|
<Label Text="{Binding Text}" FontSize="22"/>
|
|
<Label Text="{Binding Date}" FontSize="14" TextColor="Silver"/>
|
|
</StackLayout>
|
|
</DataTemplate>
|
|
</CollectionView.ItemTemplate>
|
|
</CollectionView>
|
|
|
|
</VerticalStackLayout>
|
|
</ContentPage> |