Beispiel #1
0
        private double GetLayoutScale()
        {
            var result = (VisualRoot as ILayoutRoot)?.LayoutScaling ?? 1.0;

            if (result == 0 || double.IsNaN(result) || double.IsInfinity(result))
            {
                throw new Exception($"Invalid LayoutScaling returned from {VisualRoot.GetType()}");
            }

            return(result);
        }
        public bool HitTest(Point point)
        {
            if (InputPassThroughElement is object)
            {
                var hit = VisualRoot?.GetVisualAt(point, x => x != this);

                if (hit is object)
                {
                    return(!InputPassThroughElement.IsVisualAncestorOf(hit));
                }
            }

            return(true);
        }
        public bool HitTest(Point point)
        {
            if (InputPassThroughElement is object)
            {
                var p = point.Transform(this.TransformToVisual(VisualRoot)!.Value);
                var hit = VisualRoot.GetVisualAt(p, x => x != this);

                if (hit is object)
                {
                    return !InputPassThroughElement.IsVisualAncestorOf(hit);
                }
            }

            return true;
        }