EDN Admin
Well-known member
To render Silverlight controls in my Silverlight/XNA app targeted at Windows Phone I used the exact method described in the tutorial on the following page: http://msdn.microsoft.com/en-us/library/hh221583.aspx
Next, in the GamePage() method of this Silverlight/XNA project page Ive dynamically coded several Silverlight buttons (Button class) that I add as children to an already defined XAML grid element, (ie. grid1.Children.Add(button)), underneath InitializeComponent();.
However the UIElementRenderer used to render the Silverlight content on top of the XNA content somehow fails to pick on these dynamically added Silverlight buttons. When I click the area where they are supposed to show up it does run the onClick method I
added to the buttons, so they are definately there. Static, pre-defined XAML content is displayed as well.
How would I go about having the UIElementRenderer render my dynamically added buttons along with the static XAML content? Ive tried several things (IE. make a call to this.UpdateLayout() after defining the buttons), but nothing Ive tried so far seems to
work and my knowledge of Silverlight/XNA isnt of a sufficient calibre to know how to solve this issue.
<br/>
View the full article
Next, in the GamePage() method of this Silverlight/XNA project page Ive dynamically coded several Silverlight buttons (Button class) that I add as children to an already defined XAML grid element, (ie. grid1.Children.Add(button)), underneath InitializeComponent();.
However the UIElementRenderer used to render the Silverlight content on top of the XNA content somehow fails to pick on these dynamically added Silverlight buttons. When I click the area where they are supposed to show up it does run the onClick method I
added to the buttons, so they are definately there. Static, pre-defined XAML content is displayed as well.
How would I go about having the UIElementRenderer render my dynamically added buttons along with the static XAML content? Ive tried several things (IE. make a call to this.UpdateLayout() after defining the buttons), but nothing Ive tried so far seems to
work and my knowledge of Silverlight/XNA isnt of a sufficient calibre to know how to solve this issue.
<br/>
View the full article