C
C#3mo ago
eduardoA

✅ Transparent flyout items

In my app, my flyout items are invisible, but if I manipulate my app, change the Windows size, I can see everything First time, I enter the app, I check the storage, to see if there is an email, if there is, I will send you to your specific role page. On this page you will have several options in the flyout depending on your role 1) Student 2) Teacher 3) Coordinator If you do not have an account, you need to register, and I will save your email (In order to get back your user from firebase) Problem When you have an email stored and run the app, the app will show all the items, but they are transparent (But they are there) And If I resize the Windows, they appear again (See the images below) Expectation I want to be able to see all my items. The curious part is that when you create an account and login, all the items are visible. Code https://paste.mod.gg/lkbibdxylfml/0 https://paste.mod.gg/lkbibdxylfml/1 https://paste.mod.gg/lkbibdxylfml/2 https://paste.mod.gg/lkbibdxylfml/3 https://paste.mod.gg/lkbibdxylfml/4 https://paste.mod.gg/lkbibdxylfml/5 The code running, without me manipulating the screen (Resize, maximize, etc) !image as you can see, my items are there, but I do not see them. The code running, with me manipulating the screen (Resize, maximize, etc) !image but for some reason if I turn on "Tabs", I cann the all my options
BlazeBin - lkbibdxylfml
A tool for sharing your source code with the world!
BlazeBin - lkbibdxylfml
A tool for sharing your source code with the world!
BlazeBin - lkbibdxylfml
A tool for sharing your source code with the world!
BlazeBin - lkbibdxylfml
A tool for sharing your source code with the world!
BlazeBin - lkbibdxylfml
A tool for sharing your source code with the world!
No description
32 Replies
leowest
leowest3mo ago
can you provide a github with the working project with the issue happening? If so I will take a look when im free.
eduardoA
eduardoA3mo ago
sure
eduardoA
eduardoA3mo ago
GitHub
GitHub - eduardoagr/DemyAI
Contribute to eduardoagr/DemyAI development by creating an account on GitHub.
eduardoA
eduardoA3mo ago
I have been trying to figure out what is the error use this credentials tc@tc.com 123456 is very annoying
leowest
leowest3mo ago
ok I will take a look in afew just got home
eduardoA
eduardoA3mo ago
Do not worry I fixed it What I did is that in the appshell.xmal, I disable the flyout or desktop, and in the Startup, when I call the NavigationHelper, I did this.
public static async Task NavigatoToDashboardRoleAsync(DemyUser demyUser) {
var pageNage = $"{demyUser.CurrentRole}DashboardPage";
FlyoutHelper.GetDefaultMenuItems();
FlyoutHelper.CreateFlyoutHeader(demyUser);
FlyoutHelper.CreateFlyoutMenu(demyUser?.CurrentRole!);
if (DeviceInfo.Platform == DevicePlatform.MacCatalyst
|| DeviceInfo.Platform == DevicePlatform.WinUI) {
Shell.Current.FlyoutIsPresented = true;
Shell.Current.FlyoutBehavior = FlyoutBehavior.Locked;
}
await Shell.Current.GoToAsync($"//{pageNage}", true);
}
public static async Task NavigatoToDashboardRoleAsync(DemyUser demyUser) {
var pageNage = $"{demyUser.CurrentRole}DashboardPage";
FlyoutHelper.GetDefaultMenuItems();
FlyoutHelper.CreateFlyoutHeader(demyUser);
FlyoutHelper.CreateFlyoutMenu(demyUser?.CurrentRole!);
if (DeviceInfo.Platform == DevicePlatform.MacCatalyst
|| DeviceInfo.Platform == DevicePlatform.WinUI) {
Shell.Current.FlyoutIsPresented = true;
Shell.Current.FlyoutBehavior = FlyoutBehavior.Locked;
}
await Shell.Current.GoToAsync($"//{pageNage}", true);
}
So, I think that I wasn't giving my flyout enough time to update. My question is, if that is the case, why I was able to navigate to all my pages?
leowest
leowest3mo ago
because they were being registered but the issue is a bit deeper than that There seems to be some issues with dynamically rendering the controls i.e.: if u directly add it to the Shell they show up just fine there are numerous of issues like that on the maui github https://github.com/dotnet/maui/issues/13980 so after investigating what I figured out that would be easier would be if u use a template and bind to that template and modify that collection instead of the current.item directly
eduardoA
eduardoA3mo ago
an you providde an example when I already fix it but if there is a chanse for improvementI will take it
leowest
leowest3mo ago
this works because it forces it to redraw the menu I dont have an example at hand unhappily but it would be something similar to https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/flyout?view=net-maui-8.0#replace-flyout-content
eduardoA
eduardoA3mo ago
thanks
MODiX
MODiX3mo ago
Use the /close command to mark a forum thread as answered
eduardoA
eduardoA3mo ago
hello, what I want to know, and has been buggin my mind, is, is the UI dosent know about the user or the role. How the app know what pages to give me and the navigation
leowest
leowest3mo ago
how come it doesn't know, dont u get that information when u login
eduardoA
eduardoA3mo ago
yes but I just want to undertands, why wen I save a token and launch again, it know what page to load and where to navigate. If the problem was that the app dont get the user right away, it shoud not get me the pages I need or anything I shoudt be able to navigate
leowest
leowest3mo ago
depends how u save the token and what infomration it cotains... if it have roles for example
eduardoA
eduardoA3mo ago
I only save the email of the user and in StartUp, I am dong an await, to get the user
leowest
leowest3mo ago
https://github.com/eduardoagr/DemyAI/blob/master/ViewModels/LoginPageViewModel.cs#L32 DataService<DemyUser> DemyUser have Roles that is what seems to be dictating it is that not all your code?
eduardoA
eduardoA3mo ago
that is everything I just want to undestand why Maui knows the pages and everything why why
leowest
leowest3mo ago
well because u provide it
eduardoA
eduardoA3mo ago
hahaha but the issue wa that it wasent rendering the first time, so if that was the case, it shodent know mypages or anything it shoud crash
leowest
leowest3mo ago
u mean that code wasn't there before?
eduardoA
eduardoA3mo ago
remenber the issue that the flyout was showing invisible item? well the solution was to disable the flyout until I had a user
leowest
leowest3mo ago
but u were already populating the menu so I dont see why that would be the issue
eduardoA
eduardoA3mo ago
yes but with what pages? is Maui didnt know about the user
leowest
leowest3mo ago
u did thou u were passing the authenticated user to the navigation
eduardoA
eduardoA3mo ago
so why it wasent shoing
leowest
leowest3mo ago
because of rendering issues? and when u set the flyout back to true it forces it to redraw I said that earlier
eduardoA
eduardoA3mo ago
oh but why I had to force it to re render
leowest
leowest3mo ago
:stare:
leowest
leowest3mo ago
No description
eduardoA
eduardoA3mo ago
so basically we will never know, the mistery shell In will close this, since is fixed
leowest
leowest3mo ago
well its an issue its reported so they will investigate and fix there are workarounds