Skip to content

_mainFrame is NULL in NavigationService #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
floppydisk525 opened this issue Feb 8, 2018 · 0 comments
Open

_mainFrame is NULL in NavigationService #2

floppydisk525 opened this issue Feb 8, 2018 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@floppydisk525
Copy link
Owner

The frame has a navigationService Property associated with it and I tried to copy Laurent's navigation class example from a WindowsPhone example and one line of code doesn't seem to be working like it should, at least I can't get it to work. From Laurent's NavigationService example here. The following line needs to be changed:

_mainFrame = Application.Current.RootVisual as PhoneApplicationFrame;  

I tried changing it to with help from stackoverflow but _mainFrame is alwyas NULL:

_mainFrame = LogicalTreeHelper.FindLogicalNode(Application.Current.MainWindow, "MainFrameDS") as Frame;

But didn't work, nor did this:

 _mainFrame = Application.Current.MainWindow.FindName("MainFrameDS") as Frame;
@floppydisk525 floppydisk525 added the help wanted Extra attention is needed label Feb 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant