void AssociatedObject_Loaded(object sender, RoutedEventArgs e) { _controller = PhysicsControllerMain.FindController(this.AssociatedObject); if (_controller == null) { throw new Exception("You must add a PhysicsController Behavior to the Canvas representing the main Container."); } _controller.Initialized += new PhysicsControllerMain.InitializedHandler(controller_Initialized); }
void AssociatedObject_Loaded(object sender, RoutedEventArgs e) { // also check for a physics controller behavior _physicsController = PhysicsControllerMain.FindController(this.AssociatedObject); if (_physicsController == null) { return; } _physicsController.Initialized += new PhysicsControllerMain.InitializedHandler(physicsController_Initialized); }