Listviews of Products and users

This commit is contained in:
2025-08-21 17:18:35 +02:00
parent 1649eaa992
commit 543b9c2aaf
13 changed files with 358 additions and 41 deletions

View File

@ -1,16 +1,49 @@
<?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:partial="clr-namespace:AdventureWorks.MAUI.ViewsPartial"
xmlns:vm="clr-namespace:AdventureWorks.MAUI.CommandClasses"
xmlns:model="clr-namespace:AdventureWorks.EntityLayer;assembly=AdventureWorks.EntityLayer"
x:Class="AdventureWorks.MAUI.Views.UserListView"
x:DataType="vm:UserViewModelCommands"
Title="User List">
<VerticalStackLayout VerticalOptions="Center"
HorizontalOptions="Center"
Spacing="10">
<Label
Text="User List"
FontSize="Header"
HorizontalOptions="Center" />
<Button Text="Navigate to Detali"
Clicked="NavigateToDetail_Clicked" />
</VerticalStackLayout>
<Border Style="{StaticResource Screen.Border}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<partial:HeaderView ViewTitle="User List"
ViewDescription="Use this Screen to view and manage users." />
<ListView Grid.Row="1"
ItemsSource="{Binding UserList}">
<ListView.ItemTemplate>
<DataTemplate x:DataType="model:User">
<ViewCell>
<Border Margin="8"
Padding="12">
<VerticalStackLayout Spacing="4">
<HorizontalStackLayout>
<Label FontAttributes="Bold"
FontSize="Title"
Text="{Binding LastNameFirstName}" />
</HorizontalStackLayout>
<HorizontalStackLayout>
<Label Text="Email" />
<Label Text="{Binding Email}" />
</HorizontalStackLayout>
<HorizontalStackLayout>
<Button Text="Edit" />
<Button Text="Delete" />
</HorizontalStackLayout>
</VerticalStackLayout>
</Border>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Border>
</ContentPage>