Microsoft.Phone.Controls.WrapPanel.OnOrientationPropertyChanged C# (CSharp) Метод

OnOrientationPropertyChanged() приватный Метод

private OnOrientationPropertyChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void
d Windows.UI.Xaml.DependencyObject
e Windows.UI.Xaml.DependencyPropertyChangedEventArgs
Результат void
        private static void OnOrientationPropertyChanged( DependencyObject d, DependencyPropertyChangedEventArgs e )
        {
            WrapPanel source = ( WrapPanel ) d;
            Orientation value = ( Orientation ) e.NewValue;

            // Ignore the change if requested
            if ( source._ignorePropertyChange )
            {
                source._ignorePropertyChange = false;
                return;
            }

            // Validate the Orientation
            if ( ( value != Orientation.Horizontal ) &&
                ( value != Orientation.Vertical ) )
            {
                // Reset the property to its original state before throwing
                source._ignorePropertyChange = true;
                source.SetValue( OrientationProperty, ( Orientation ) e.OldValue );

                string message = string.Format(
                    CultureInfo.InvariantCulture,
                    "Properties.Resources.WrapPanel_OnOrientationPropertyChanged_InvalidValue",
                    value );
                throw new ArgumentException( message, "value" );
            }

            // Orientation affects measuring.
            source.InvalidateMeasure();
        }
        #endregion public Orientation Orientation