private void OnDatabasesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { Commands.ShowNavigationPanel.ExecuteOnMain(true); if (e.Action == NotifyCollectionChangedAction.Add) { var firstItem = e.NewItems.OfType <object>().FirstOrDefault(); _view?.FocusItem(firstItem, true); } }
private void OnDatabasesCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { Commands.ShowNavigationPanel.ExecuteOnMainWindow(true); NotifyOfPropertyChange(nameof(IsEmpty)); NotifyOfPropertyChange(nameof(HasAnyDatabaseOpen)); if (e.Action == NotifyCollectionChangedAction.Add) { var firstItem = e.NewItems.OfType <object>().FirstOrDefault(); _view?.FocusItem(firstItem, true); } }