c# - How to dynamically load Page from xaml file/resource? -


in codebehind, need load page object xaml resource, , explicitly need result instance of object of page class. have searched around , found solutions involving xamlreader , such, looked bit weird , complicated, hacks. there simple , "normal" way it?

page p = (page)application.loadcomponent(new uri(@"relative/uri/to/xaml/file.xaml", urikind.relative)); 

see msdn reference page few more details


Comments

Popular posts from this blog

ruby on rails - Is it the correct way to implement belongs_to relation with factory girl? -

geolocation - Windows Phone 8 - Keeping background location tracking active beyond four hours -

Uncaught TypeError: Cannot read property 'parentNode' of null javascript -