I am working on a Silverlight/XNA game. Having structure like this :
- My GamePlay class is inherited from InGamePage.
- Where InGamePage is inherited from PhoneApplicationPage.
- InGamePage has a OnLayoutUpdated method to render SL controls(using UIElementRenderer ).
This is as per SL/XNA code sample
Everything is working fine till I decided to create a textblock in gamepage.xaml . I want that textBlock to show the some static game variables( like distance covered by hero).
Now where should I write this line :
debugTextBlock.Text = GameData.data.distanceCovered;
so that textblock shows the current values. (I tried to hook a LayoutUpdate but its throwing Application_UnhandledException saying "Layout cycle detected. Layout could not complete.")
Any hint/link is highly appreciated.