Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Silverlight 2 RTW RSS

1 reply

Last post Oct 16, 2008 04:44 PM by ryjax2

(0)
  • ryjax2

    ryjax2

    Member

    6 Points

    11 Posts

    Silverlight 2 RTW

    Oct 16, 2008 04:32 PM | LINK

    I just upgraded from silverlight 2  beta 2 to silverlight 2 RTW.

    Now, I am getting an error with one of my controls.

     
    public partial class MainCanvas : UserControl

    {

    ...
    }
     

    My issue is that I am getting the following error:

     Error    7    'SilverlightApp.MainCanvas' does not contain a definition for 'HitTest' and no extension method 'HitTest' accepting a first argument of type 'SilverlightApp.MainCanvas' could be found (are you missing a using directive or an assembly reference?)

     
    I really hope HitTest( ) wasn't removed from UserControls since the functionality of my app relies heavily on it.


     

  • ryjax2

    ryjax2

    Member

    6 Points

    11 Posts

    Re: Silverlight 2 RTW

    Oct 16, 2008 04:44 PM | LINK

    I think I may have found the answer.

    It looks like the hittest was moved to a helper class

    VisualTreeHelper.FindElementsInHostCoordinates( )

    I'm hoping the just adding a method to my classes will fix the problem.

            private IEnumerable<UIElement> HitTest(Point p)
            {
                return VisualTreeHelper.FindElementsInHostCoordinates(p, this);
            }