this post was submitted on 09 Feb 2024
3 points (80.0% liked)

C Sharp

1532 readers
2 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 1 year ago
MODERATORS
 

cross-posted from: https://programming.dev/post/9780587

In MAUI 8.03 we had the Flyout bug where the NavigationPage Title wouldn't update from the first page you had been on. In MAUI 8.06 that bug has been fixed but has introduced a new one on Windows (sigh).

Starting on Page1 I can use the Flyout to switch to Page2. Then, on Windows, if I use Flyout to switch back to already-existing Page1 it crashes with...

System.Runtime.InteropServices.COMException (0x800F1000): No installed components were detected.

Element is already the child of another element

It works on Android, and it works if you are creating a new page each time, it just doesn't work on Windows to switch back to an already-created page (which defeats the whole purpose of having a Flyout menu - switch between 2 pages without making a new one every time).

  1. Does anyone know of a workaround to this? I can't find anything that relates to this in the context of a MAUI Flyout.
  2. Does anyone have a real simple Flyout template that could be used for the repro (to put in the issue I'm gonna need to create). The one I'm working on has a whole bunch of my own libraries in it, so I'm gonna need to tear them all out before I can use it to make a repro (and of course they don't provide a template, and their sample doesn't work due to different bugs - sigh).
top 2 comments
sorted by: hot top controversial new old
[โ€“] SmartmanApps 1 points 8 months ago

I finally fixed up the MAUI/VS upgrade issues, recloned, added my code back in one part at a time, and the bug came back so I've now narrowed down where the issue is - it happens when I try to use a HorizontalStackLayout in my TitleView on Windows. This code absolutely was working in 8.0.3, and still works on Android in 8.0.6. (I haven't tried 8.0.7 yet cos I wanted to keep everything exactly the same as before whilst I added code back in seeing if the issue came back). Anyone have any ideas about this one?

[โ€“] SmartmanApps 1 points 8 months ago

I've narrowed this down to using NavigationPage.SetTitleView and have created issue 21037, which has an 806issue branch in the repro repo.