/// <summary> /// Fired when the SelectedItem changes. /// </summary> /// <param name="d">The sender</param> /// <param name="e">The event args</param> /// <remarks> /// Sets up animations for the DetailsPresenter for animating in/out. /// </remarks> private static void OnSelectedItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MasterDetailsView view = (MasterDetailsView)d; // Prevent setting the SelectedItem to null if only the order changed (=> collection reset got triggered). if (!view.ignoreClearSelectedItem && !(e.OldValue is null) && e.NewValue is null && view.Items.Contains(e.OldValue)) { view.SelectedItem = e.OldValue; return; } view.OnSelectionChanged(new SelectionChangedEventArgs(new List <object> { e.OldValue }, new List <object> { e.NewValue })); view.UpdateView(true); // If there is no selection, do not remove the DetailsPresenter content but let it animate out. if (view.SelectedItem != null) { view.SetDetailsContent(); } }
/// <summary> /// Fired when the MasterCommandBar changes. /// </summary> /// <param name="d">The sender</param> /// <param name="e">The event args</param> private static void OnMasterCommandBarChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MasterDetailsView view = (MasterDetailsView)d; view.OnMasterCommandBarChanged(); }
private static void OnBackButtonBehaviorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MasterDetailsView view = (MasterDetailsView)d; view.SetBackButtonVisibility(); }
/// <summary> /// Fired when the <see cref="MasterHeader"/> is changed. /// </summary> /// <param name="d">The sender</param> /// <param name="e">The event args</param> private static void OnMasterHeaderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MasterDetailsView view = (MasterDetailsView)d; view.SetMasterHeaderVisibility(); }