Dodano edycje danych osoby - Zmodyfikowano User.cs, DetailedViewModel.cs, DetailedPage.xaml oraz MainPage.xaml
This commit is contained in:
+11
-5
@@ -1,9 +1,15 @@
|
||||
<?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"
|
||||
x:Class="Navigation_Between.View.DetailedPage">
|
||||
<VerticalStackLayout>
|
||||
<Label Text="{Binding Name}" FontSize="24" FontAttributes="Bold" />
|
||||
<Label Text="{Binding Description}" FontSize="18" FontAttributes="Italic" />
|
||||
|
||||
<VerticalStackLayout Padding="20">
|
||||
<Label Text="Nazwa:" FontSize="20" />
|
||||
<Label Text="{Binding SelectedUser.Name}" FontSize="24" FontAttributes="Bold" />
|
||||
<Label Text="Opis:" FontSize="20" />
|
||||
<Label Text="{Binding SelectedUser.Description}" FontSize="18" />
|
||||
<Button Text="Edytuj opis" Command="{Binding EditDescriptionCommand}" />
|
||||
<Label Text="E-mail:" FontSize="20" />
|
||||
<Label Text="{Binding SelectedUser.Email}" FontSize="18" />
|
||||
<Button Text="Edytuj e-mail" Command="{Binding EditEmailCommand}" />
|
||||
</VerticalStackLayout>
|
||||
</ContentPage>
|
||||
</ContentPage>
|
||||
|
||||
+7
-2
@@ -2,7 +2,7 @@
|
||||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
x:Class="Navigation_Between.View.MainPage"
|
||||
xmlns:local="clr-namespace:Navigation_Between.ViewModel">
|
||||
x:Name="MainPage">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout
|
||||
@@ -13,7 +13,12 @@
|
||||
<DataTemplate>
|
||||
<Label Text="{Binding Name}" FontSize="Large">
|
||||
<Label.GestureRecognizers>
|
||||
<TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type local:MainViewModel}}, Path=SelectUserCommand}" CommandParameter="{Binding}" />
|
||||
<!--
|
||||
Poprzednia wersja zapisu wyglądała następująco:
|
||||
<TapGestureRecognizer Command="{Binding Source={RelativeSource AncestorType={x:Type local:MainViewModel}}, Path=SelectUserCommand}" CommandParameter="{Binding}" />
|
||||
Ale ta zmiana wymaga dodania x:Name="MainPage" w ContentPage!
|
||||
-->
|
||||
<TapGestureRecognizer Command="{Binding Source={x:Reference MainPage}, Path=BindingContext.SelectUserCommand}" CommandParameter="{Binding}" />
|
||||
</Label.GestureRecognizers>
|
||||
</Label>
|
||||
</DataTemplate>
|
||||
|
||||
Reference in New Issue
Block a user