예제 #1
0
        /// <summary>
        /// Responds to specific keyboard input and invokes associated scrolling behavior.
        /// </summary>
        /// <param name="e">Required arguments for this event.</param>
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.Handled || e.OriginalSource.Equals(this))
            {
                base.OnKeyDown(e);
                return;
            }

            // Don't eat left/right if horizontal scrolling is disabled
            if (e.Key == Key.Left || e.Key == Key.Right)
            {
                if (HorizontalScrollBarVisibility == ScrollBarVisibility.Disabled || HorizontalOffset.Equals(0))
                {
                    return;
                }
            }

            // Don't eat up/down if vertical scrolling is disabled
            if (e.Key == Key.Up || e.Key == Key.Down)
            {
                if (VerticalScrollBarVisibility == ScrollBarVisibility.Disabled || VerticalOffset.Equals(0))
                {
                    return;
                }
            }

            // Let the base class do it's thing
            base.OnKeyDown(e);
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            var other = obj as HeightMeasurements;

            return(other != null &&
                   DistanceTop.Equals(other.DistanceTop) &&
                   AngleTop.Equals(other.AngleTop) &&
                   DistanceBottom.Equals(other.DistanceBottom) &&
                   AngleBottom.Equals(other.AngleBottom) &&
                   VerticalOffset.Equals(other.VerticalOffset));
        }