private void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case nameof(ViewModel.GroupedFontList): if (ViewModel.IsLoadingFonts) { return; } if (ViewModel.Settings.UseSelectionAnimations && !ViewModel.IsSearchResults) { Composition.PlayEntrance(LstFontFamily, 66, 100); Composition.PlayEntrance(GroupLabel, 0, 0, 80); if (InlineLabelCount.Visibility == Visibility.Visible) { Composition.PlayEntrance(InlineLabelCount, 83, 0, 80); } } break; case nameof(ViewModel.SelectedFont): if (ViewModel.SelectedFont != null) { LstFontFamily.SelectedItem = ViewModel.SelectedFont; FontMap.PlayFontChanged(); } break; case nameof(ViewModel.FontSearch): case nameof(ViewModel.IsSearchResults): // Required to prevent crash with SemanticZoom when there // are no items in the results list if (!FontsSemanticZoom.IsZoomedInViewActive) { FontsSemanticZoom.IsZoomedInViewActive = true; } break; case nameof(ViewModel.IsLoadingFonts): case nameof(ViewModel.IsLoadingFontsFailed): UpdateLoadingStates(); break; } }
private void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { switch (e.PropertyName) { case nameof(ViewModel.GroupedFontList): if (ViewModel.IsLoadingFonts) { return; } if (ViewModel.Settings.UseSelectionAnimations) { Composition.PlayEntrance(LstFontFamily, 66, 100); Composition.PlayEntrance(GroupLabel, 0, 0, 80); if (InlineLabelCount.Visibility == Visibility.Visible) { Composition.PlayEntrance(InlineLabelCount, 83, 0, 80); } } break; case nameof(ViewModel.SelectedFont): if (ViewModel.SelectedFont != null) { LstFontFamily.SelectedItem = ViewModel.SelectedFont; FontMap.PlayFontChanged(); } break; case nameof(ViewModel.IsLoadingFonts): case nameof(ViewModel.IsLoadingFontsFailed): UpdateLoadingStates(); break; } }