c# - Open a xaml page from one project in another project in the same solution -


i appreciate this. have c# solution called public library different projects in it. 1 project called books.view i'm working on main page loads upon startup , user data entry , other tasks pages , other project called menu. menu project contains application settings admin able make changes. have added settings button mainwindow.xaml page located in books.view project , open mainsettings.xaml located in menu project.

i have searched on here different questions regarding similar questions such as: how navigate project inside same solution

redirect page in different project of same solution

it mentioned adding reference, added reference books.view project menu project. tried following code in settings button in main project books.view:

navigationservice.navigate(new uri("/menu;/mainsettings.xaml", urikind.relative)); 

then receive error stating object reference required non-static field, method or property ‘system.windows.navigation.navigationservice.navigate(system.uri)’.

any assistance appreciated.

thank you

review uri scheme references xaml in msdn.

as referencing xaml separate project, have use qualified uri. assuming other project assembly name menu, should like:

navigationservice.navigate(new uri("pack://application:,,,/menu;component/mainsettings.xaml", urikind.absolute)); 

above based on reference xaml uri in separate assembly (which documented in msdn link):

pack://application:,,,/referencedassembly;component/subfolder/resourcefile.xaml 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -