private void Window_Loaded(object sender, RoutedEventArgs e) { _isLoading = true; clientRoomDataGrid.ItemsSource = _repo.ClientRoomListInMemory(); _clientRoomViewSource = (ObjectDataProvider)FindResource("clientRoomViewSource"); _isLoading = false; clientRoomDataGrid.SelectedIndex = 0; }