private async Task LoadBuildings() { BuildingBox.ClearValue(ItemsControl.ItemsSourceProperty); BuildingBox.DisplayMemberPath = "Name"; BuildingBox.SelectedValuePath = "BuildingID"; BuildingBox.ItemsSource = await roomCore.GetAssignedBuildingsForConferenceAsync(UserCredentials.Conference.ConferenceId); RoomBox.ClearValue(ItemsControl.ItemsSourceProperty); }
private async Task LoadBuildings() { BuildingBox.ClearValue(ItemsControl.ItemsSourceProperty); BuildingBox.DisplayMemberPath = "Name"; BuildingBox.SelectedValuePath = "BuildingID"; BuildingBox.ItemsSource = await roomCore.GetAssignedBuildingsForConferenceAsync(UserCredentials.Conference.ConferenceId); if (RoomBox.SelectedIndex >= 0) { lastSelectedRoom = (RoomDTO)RoomBox.SelectedItem; } RoomBox.ClearValue(ItemsControl.ItemsSourceProperty); if (lastSelectedRoom != null) { BuildingBox.SelectedValue = lastSelectedRoom.BuildingID; } }