Пример #1
0
        private static void OrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            WaterfallPanel obj   = (WaterfallPanel)d;
            Orientation    value = (Orientation)e.NewValue;

            if (Enum.IsDefined(typeof(Orientation), value) == false)
            {
                throw new ArgumentException("orientation is not defined.", nameof(value));
            }

            obj.InvalidateMeasure();
        }
Пример #2
0
        private static void ColumnCountChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            WaterfallPanel obj   = (WaterfallPanel)d;
            int            value = (int)e.NewValue;

            if (value <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(value));
            }

            obj.InvalidateMeasure();
        }