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

Line ending issue with Mercurial or Visual Studio -

python - Received unregistered task using Celery with Django -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -