C
C#8mo 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
leowest8mo 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
eduardoAOP8mo ago
sure
eduardoA
eduardoAOP8mo ago
GitHub
GitHub - eduardoagr/DemyAI
Contribute to eduardoagr/DemyAI development by creating an account on GitHub.
eduardoA
eduardoAOP8mo ago
I have been trying to figure out what is the error use this credentials [email protected] 123456 is very annoying
leowest
leowest8mo ago
ok I will take a look in afew just got home
eduardoA
eduardoAOP8mo 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
leowest8mo 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
eduardoAOP8mo ago
an you providde an example when I already fix it but if there is a chanse for improvementI will take it
leowest
leowest8mo 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
eduardoAOP8mo ago
thanks
MODiX
MODiX8mo ago
Use the /close command to mark a forum thread as answered
eduardoA
eduardoAOP8mo 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
leowest8mo ago
how come it doesn't know, dont u get that information when u login
eduardoA
eduardoAOP8mo 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
leowest8mo ago
depends how u save the token and what infomration it cotains... if it have roles for example
eduardoA
eduardoAOP8mo ago
I only save the email of the user and in StartUp, I am dong an await, to get the user
leowest
leowest8mo 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
eduardoAOP8mo ago
that is everything I just want to undestand why Maui knows the pages and everything why why
leowest
leowest8mo ago
well because u provide it
eduardoA
eduardoAOP8mo 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
leowest8mo ago
u mean that code wasn't there before?
eduardoA
eduardoAOP8mo 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
leowest8mo ago
but u were already populating the menu so I dont see why that would be the issue
eduardoA
eduardoAOP8mo ago
yes but with what pages? is Maui didnt know about the user
leowest
leowest8mo ago
u did thou u were passing the authenticated user to the navigation
eduardoA
eduardoAOP8mo ago
so why it wasent shoing
leowest
leowest8mo ago
because of rendering issues? and when u set the flyout back to true it forces it to redraw I said that earlier
eduardoA
eduardoAOP8mo ago
oh but why I had to force it to re render
leowest
leowest8mo ago
:stare:
leowest
leowest8mo ago
No description
eduardoA
eduardoAOP8mo ago
so basically we will never know, the mistery shell In will close this, since is fixed
leowest
leowest8mo ago
well its an issue its reported so they will investigate and fix there are workarounds
Want results from more Discord servers?
Add your server