Yanshof
Yanshof

Reputation: 9926

How to access page that i navigate?

I have page that i navigate to him

xaml:

<sdk:Frame x:Name="frameNavigator" Source="/Views/page0.xaml" JournalOwnership="OwnsJournal" Navigated="NavigatedPage_Event" />

The code:

frameNavigator.Navigate( new Uri( "/Views/Page1.xaml", UriKind.Relative ) );

I want to have ability to access to page1 from the main class that hold the page.

How can i do it ?

Upvotes: 1

Views: 165

Answers (1)

Derek Beattie
Derek Beattie

Reputation: 9478

Even if you're not using the MVVM pattern you could use MVVM-Lights messaging.

Register in your child view:

 Messenger.Default.Register<NotificationMessage>(this, "MyToken", DoSomething);

Send from your parent view:

 Messenger.Default.Send(new NotificationMessage(this, "SomeData"), "MyToken");

Example app: https://bitbucket.org/dbeattie/navdemo

Upvotes: 1

Related Questions