Komentarze :)

This commit is contained in:
Krzysztof KrzysiekSiemv Smaga
2025-03-17 21:05:12 +01:00
parent 19037d6d4a
commit e4ef84ff14
+3 -2
View File
@@ -14,10 +14,12 @@ public class DetailedViewModel
{ {
SelectedUser = user; SelectedUser = user;
// Przypisanie metod asynchronicznych do poleceń
EditDescriptionCommand = new Command(async () => await EditDescription()); EditDescriptionCommand = new Command(async () => await EditDescription());
EditEmailCommand = new Command(async () => await EditEmail()); EditEmailCommand = new Command(async () => await EditEmail());
} }
// Ze względu na użycie DisplayPropmtAsync, metoda musi być asynchroniczna
private async Task EditDescription() private async Task EditDescription()
{ {
string result = await Shell.Current.DisplayPromptAsync( string result = await Shell.Current.DisplayPromptAsync(
@@ -43,8 +45,7 @@ public class DetailedViewModel
SelectedUser.Email SelectedUser.Email
); );
if (!string.IsNullOrWhiteSpace(result)) if (!string.IsNullOrWhiteSpace(result)) {
{
SelectedUser.Email = result; SelectedUser.Email = result;
} }
} }