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

codeigniter - Fatal error: Call to undefined function lang() in CI Merchant using CardSave -

javascript - CasperJS/PhantomJS failing SSL handshakes on some sites even with --ssl-protocol=any -

python - Received unregistered task using Celery with Django -