Skip to content

Help! The app crashes when it starts. #8933

Answered by Daoting
Daoting asked this question in Q&A
Discussion options

You must be logged in to vote

I need a multi-layer UI interface, so the root element is Grid.
MainWin.Content = RootGrid;
And th frame is added dynamically after window activation. This may be the problem.

On android, just add a line of new Frame().Navigate(typeof(Page)); at the beginning and everything works fine. Even if the frame is not placed in the visual tree. I used this method to temporarily fix the bug on android.

#if WIN
            MainWin = new Window { Title = Stub.Inst.Title };
            MainWin.Activate();
#else
            MainWin = Window.Current;
#endif

#if ANDROID
            new Frame().Navigate(typeof(Page));
#endif

            RootGrid = new Grid();

            _dlgCanvas = new Canvas();
   …

Replies: 3 comments 15 replies

Comment options

You must be logged in to vote
3 replies
@Daoting
Comment options

@jeromelaban
Comment options

@Daoting
Comment options

Comment options

You must be logged in to vote
5 replies
@jeromelaban
Comment options

@Daoting
Comment options

@jeromelaban
Comment options

@jeromelaban
Comment options

@Daoting
Comment options

Answer selected by Daoting
Comment options

You must be logged in to vote
7 replies
@Daoting
Comment options

@jeromelaban
Comment options

@Daoting
Comment options

@jeromelaban
Comment options

@Daoting
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants