/// <summary> /// RevealModeProperty property changed handler. /// </summary> /// <param name="dependencyObject">ExpandableContentControl that changed its RevealMode.</param> /// <param name="e">Event arguments.</param> private static void OnRevealModePropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { ExpandableContentControl source = (ExpandableContentControl)dependencyObject; ExpandDirection value = (ExpandDirection)e.NewValue; if (value != ExpandDirection.Down && value != ExpandDirection.Left && value != ExpandDirection.Right && value != ExpandDirection.Up) { // revert to old value source.RevealMode = (ExpandDirection)e.OldValue; string message = string.Format( CultureInfo.InvariantCulture, AccordionResources.Expander_OnExpandDirectionPropertyChanged_InvalidValue, value); throw new ArgumentException(message, "e"); } // set the non-reveal dimension source.SetNonRevealDimension(); // calculate the reveal dimension source.SetRevealDimension(); }
/// <summary> /// PercentageProperty property changed handler. /// </summary> /// <param name="dependencyObject">Page that changed its Percentage.</param> /// <param name="e">Event arguments.</param> private static void OnPercentagePropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e) { ExpandableContentControl source = (ExpandableContentControl)dependencyObject; source.SetRevealDimension(); source.InvalidateMeasure(); }