Swipeout... clicking on "swipeitem" causes the refreshview of hosted collection to be called!

Stewart Basterash 81 Reputation points
2024-04-08T22:25:45.59+00:00

I've been running into some odd control behaviour as I'm manually deep diving a conversion. This is not a critical conversion, but it has been exposing a lot of Maui issues that may or may not be insurmountable if it were.

I have an ObservableCollection that hosts 8 objects. Each displayed item is in a Border and I have each border item using a "Swipeview" to expose two navigation options (history, and detail). Although this works, there are two issues.

First... the 8 item collection is hosted by a "RefreshView". Allthough everything works, when a primary border option is swipeed (left), everything is still fine, but once I "tap" on one of the "swipeitems", it executes the parent "RefreshView" pull to refresh MVVM method. This should not happen and could cause some serious data issues.

Second... The action of "tapping" on one of the options causes a detail or history "Page" to be navigated to. Despite having them set up in the Mauiprogram.cs (initialization) and in AppXaml.cs (routing). There is a significant wait time on the page to be navigated to if there is some custom configuration that needs to be done prior to display (and there does). In my case several preliminary controls need to be initialized in the view, by the viewmodel. This configuration, and display process can take 20 to 30 seconds. This DOES NOT HAPPEN in my Xamarin version. And in fact, there is no time at all between the click, sliding navigation and view of the detail page. Any thoughs?

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,895 questions
{count} votes