ArcGISPortalViewer.Controls.Primitives.UniformGrid.OnIntegerDependencyPropertyChanged C# (CSharp) Method

OnIntegerDependencyPropertyChanged() private static method

Validate the new property value and silently revert if the new value is not appropriate. Used in place of WPF value coercian by the dependency properties in UniformGrid.
private static OnIntegerDependencyPropertyChanged ( DependencyObject o, DependencyPropertyChangedEventArgs e ) : void
o Windows.UI.Xaml.DependencyObject The dependency object.
e Windows.UI.Xaml.DependencyPropertyChangedEventArgs The dependency property.
return void
        private static void OnIntegerDependencyPropertyChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            // Silently coerce the value back to >= 0 if negative.
            if (!(e.NewValue is int) || (int)e.NewValue < 0)
            {
                o.SetValue(e.Property, e.OldValue);
            }
        }