/// <summary> /// Handles changes to the FadeTransitioningContentTemplate property. /// </summary> /// <param name="d"> /// The <see cref="DependencyObject"/> on which /// the property has changed value. /// </param> /// <param name="e"> /// Event data that is issued by any event that /// tracks changes to the effective value of this property. /// </param> private static async void OnFadeTransitioningContentTemplateChanged( DependencyObject d, DependencyPropertyChangedEventArgs e) { DataTemplate oldFadeTransitioningContentTemplate = (DataTemplate)e.OldValue; DataTemplate newFadeTransitioningContentTemplate = (DataTemplate)d.GetValue(FadeTransitioningContentTemplateProperty); await d.FadeOut(); ((ContentControl)d).ContentTemplate = newFadeTransitioningContentTemplate; await d.FadeIn(); }