private void Window_Loaded(object sender, RoutedEventArgs e) { _isLoading = true; RoomListBox.ItemsSource = _repo.RoomsListInMemory(); _roomsViewSource = (ObjectDataProvider)FindResource("roomViewSource"); _isLoading = false; RoomListBox.SelectedIndex = 0; }