Replies: 1 comment
-
|
hi @bnSonic, could try looking up the window life cycle event. You may be able to see an event to hook on to achieve your result. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Since MAUI we should use the App.xaml.cs
instead of setting
MainPageNow I have a problem on Android Tablets.
I have tested on a Samsung Tablet in Dex-Mode (this Desktop Mode)
When the user resizes the App-Window it happens, that the
CreateWindowis called (not every time but very very often)That's a problem (currently) because in the
CreateWindowI expected the App to run into on the first start. So I create a Blank Page here … (when app starts fresh, the app.xaml.cs is calling an automated login on a first-welcome screen with a login later … all with doing a navigation or resetting the Windows[0].Page after a Login/Connection finished etc.)And of course I don't want the App to completely start from scratch only because the user tries to resize the window ;)
I can see, that when the 'CreateWindow' is called because of a resize-action, the
activationState-Parameter is set and filled with stuff. Maybe something with that could help?I've already tried to save my current Window[0] and reuse it like:
But then I got a "MauiContext is null" exception.
So my questions are:
a) why is the CreateWindow called on a resize in the first place?
b) is it possible to avoid that? It's a single-window-app and it's able to resize its content (XAML is doing a good job here). I like the app to be resized - but I don't want it to create a new window for that
c) if b) is not possible - then how could I return a Window in
CreateWindowthat contains the "old" MasterDetail-Page with it's FlyoutMenu and it's Detail-Page with all it's Navigation-Stack?I'm not using the
Shellbut classic Navigation PagesI yet have to test if this problem occurs in the simpler split-screen-view on that android tablet too and if such problem could be solved by using
MainPageagain … but that's deprecated, right? so …Thank you very much - I really hope there is an (easy?) solution to this.
EDIT:
Sure enough:
CreateWindowis called and I don't know how to maintain the current Main-PageMainPage = ...WORKS! It gives compiler warnings (obsolete, deprecated) but it works in side-by-side mode and in Dex-Mode with resizing Windows.So current workaround is to use the good old
MainPage-approach … but this cannot be the solution as this is deprecated already.I still hope that anyone knows how to do this with the
CreateWindowlogic (or even better: knows how to avoid getting acreateWindowCall when the window is resized.Beta Was this translation helpful? Give feedback.
All reactions