This project is read-only.

How to access uiElement functions from game canvas

Mar 19, 2013 at 10:25 PM
Edited Mar 19, 2013 at 10:30 PM
Hi :)

I would like to run a function inside one of my user controls that is inside the main PhysicsCanvas.
I found this code in the physics helper manual but can't find the "uiElement" property in my code.
Any tips would be ideas appreciated! :D
Ellipse ball = _physicsController.PhysicsObjects["ball"].uiElement as Ellipse;
ball.Fill = new SolidColorBrush(Colors.Red);
This is what I got:
void spr_Tapped(object sender, TappedRoutedEventArgs e)
            PhysicsSprite spr = sender as PhysicsSprite;

            //would like to run a function that is in the PhysicsSprite here

            cnvGame.DeletePhysicsObject((sender as PhysicsSprite).Name);
Just found "UserControlParent" but it seems to return null for me, hm.....