private async void OnTabSelectionChanged() { if (SelectedTabIndex == 1) { ShowLoadingProcess = Visibility.Visible; var symbolCollections = await GetSymbolCollection(); // Handle edge-case where project has no styles: if (symbolCollections == null) { AllSymbolCollections = new ObservableCollection <Symbol>(); ShowLoadingProcess = Visibility.Collapsed; return; } SymbolCollections = new ObservableCollection <Symbol>(symbolCollections); AllSymbolCollections = new ObservableCollection <Symbol>(symbolCollections); SelectedStyleItem = (SelectedSymbolObject == null) ? SymbolCollections.FirstOrDefault() : SelectedSymbolObject; SelectedSymbolText = SelectedStyleItem.SymbolText; ColorPickerCollection = new ObservableCollection <PropertyInfo>(typeof(System.Windows.Media.Brushes).GetProperties()); SelectedColor = (SelectedColorObject == null) ? ColorPickerCollection.Where(x => x.Name == "Red").FirstOrDefault() : SelectedColorObject; SelectedBrush = (System.Windows.Media.Brush)SelectedColor.GetValue(null, null); ShowLoadingProcess = Visibility.Collapsed; } }