Пример #1
0
        //------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------

        #region Internal Methods

        /// <summary>
        /// Hit test on the children
        /// </summary>
        /// <param name="point"></param>
        /// <returns></returns>
        internal UIElement HitTestOnElements(Point point)
        {
            UIElement hitElement = null;

            // Do hittest.
            HitTestResult hitTestResult = VisualTreeHelper.HitTest(this, point);

            // Now find out which element is hit if there is a result.
            if (hitTestResult != null)
            {
                Visual visual = hitTestResult.VisualHit as Visual;
                System.Windows.Media.Media3D.Visual3D visual3D = hitTestResult.VisualHit as System.Windows.Media.Media3D.Visual3D;

                DependencyObject currentObject = null;
                if (visual != null)
                {
                    currentObject = visual;
                }
                else if (visual3D != null)
                {
                    currentObject = visual3D;
                }

                while (currentObject != null)
                {
                    DependencyObject parent = VisualTreeHelper.GetParent(currentObject);
                    if (parent == InkCanvas.InnerCanvas)
                    {
                        // Break when we hit the inner canvas in the visual tree.
                        hitElement = currentObject as UIElement;
                        Debug.Assert(Children.Contains(hitElement), "The hit element should be a child of InnerCanvas.");
                        break;
                    }
                    else
                    {
                        currentObject = parent;
                    }
                }
            }

            return(hitElement);
        }
 public System.Windows.Media.Media3D.GeneralTransform2DTo3D TransformToAncestor(System.Windows.Media.Media3D.Visual3D ancestor)
 {
     return(default(System.Windows.Media.Media3D.GeneralTransform2DTo3D));
 }
Пример #3
0
        public static System.Windows.Media.Media3D.Rect3D GetContentBounds(System.Windows.Media.Media3D.Visual3D reference)
        {
            Contract.Requires(reference != null);

            return(default(System.Windows.Media.Media3D.Rect3D));
        }
Пример #4
0
 public static void HitTest(System.Windows.Media.Media3D.Visual3D reference, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, System.Windows.Media.Media3D.HitTestParameters3D hitTestParameters)
 {
     Contract.Requires(reference != null);
     Contract.Requires(resultCallback != null);
     Contract.Requires(hitTestParameters != null);
 }