Refactor PublicWalkRequestCreateViewModel to improve dog selection logic and ensure UI updates correctly
This commit is contained in:
parent
d72c84ef5f
commit
4096227525
@ -526,7 +526,7 @@ namespace gehGassiApp.ViewModels.Walks
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Laden der initialen Daten
|
||||
@ -597,6 +597,8 @@ namespace gehGassiApp.ViewModels.Walks
|
||||
CheckSubscription(AppMode.DogOwner);
|
||||
}
|
||||
}
|
||||
DogSelectionChanged();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -615,10 +617,22 @@ namespace gehGassiApp.ViewModels.Walks
|
||||
{
|
||||
Dogs = dogs.ToObservableCollection();
|
||||
SelectedDog = Dogs.FirstOrDefault();
|
||||
|
||||
// Ersten Hund automatisch zur Auswahl hinzufügen
|
||||
if (Dogs.Count > 0)
|
||||
{
|
||||
SelectedDogs.Clear();
|
||||
SelectedDogs.Add(Dogs.First());
|
||||
DogsSelected = true;
|
||||
|
||||
// DogSelectionChanged Command manuell auslösen für UI-Update
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Dogs?.Clear();
|
||||
SelectedDogs?.Clear();
|
||||
DogsSelected = false;
|
||||
}
|
||||
|
||||
HasNoDog = Dogs.Count == 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user