Need suggestion on Silverlight application
I am a beginner in silver light. I created a test application, in which on top there are menus like Home, About Us etc?? and there is a grid control to show content related to menu.
I created controls for Home, About Us etc, and I add this control on a click of associated menu. but I am looking for some generic way, rather than handling click of each menu separately, I also created a common click event, but the problem how can I get the Home COntrol o开发者_高级运维r a About Us Control to add in a grid. In click event method I can get the clicked menu Information. I can write switch statement but it will also not called as a generic.
Something Like find a particular page/Control by its name in a whole silverlight application and add it to my grid.
Thanx!
Take a look at Ria Services and MEF. I'm currently on a Silverlight project and we are relying heavily on Ria Services and MEF. We are using a VMMV approach. It's working out nicely.
Silverlight has the Frame and Page controls to help you with some of these issues.
Check out: http://msdn.microsoft.com/en-us/library/cc838245%28v=vs.95%29.aspx
This could be solved by using silverlight navigation, have a look at this blog and here
you can then do something like:
this.MainFrame.Navigate(new Uri("Page2.Xaml",UriKind.Relative));
// where page 2 is your page name taken from your menu item
精彩评论