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>
|
/// <summary>
|
||||||
/// Laden der initialen Daten
|
/// Laden der initialen Daten
|
||||||
@ -597,6 +597,8 @@ namespace gehGassiApp.ViewModels.Walks
|
|||||||
CheckSubscription(AppMode.DogOwner);
|
CheckSubscription(AppMode.DogOwner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DogSelectionChanged();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -615,10 +617,22 @@ namespace gehGassiApp.ViewModels.Walks
|
|||||||
{
|
{
|
||||||
Dogs = dogs.ToObservableCollection();
|
Dogs = dogs.ToObservableCollection();
|
||||||
SelectedDog = Dogs.FirstOrDefault();
|
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
|
else
|
||||||
{
|
{
|
||||||
Dogs?.Clear();
|
Dogs?.Clear();
|
||||||
|
SelectedDogs?.Clear();
|
||||||
|
DogsSelected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
HasNoDog = Dogs.Count == 0;
|
HasNoDog = Dogs.Count == 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user