Maui Observations #18063
Unanswered
Stedy59
asked this question in
Show and tell
Maui Observations
#18063
Replies: 1 comment 2 replies
-
@Stedy59 any chance you are releasing your controls as a nuget or opensource ? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am in the process of migrating a rather large Xamarin framework to .NET Maui.
The original Xamarin framework was focused on the migration of Windows CE/Mobile applications to Android. Some features were required to facilitate the "ease of migrating" users to a new application on a new OS. Therefore, considerable effort went into renderers that created Windows "Like" functionality. About 75 percent of my time is spent at the Handler layer and OS layers.
Now, I have been tasked with not only migrating the current framework to .NET Maui, but also, the ability to target Windows tablet/kiosk devices in the future.
Observation #1: The Maui Handler architecture is wonderful to work with! Especially since the ICrossPlatformLayout interface was adopted during the .net8 preview process.
With that being said, once I map a View/ContentView/ContentPage/etc. to a Handler, from then on, it's OS targeted code! Many times, I authored and perfected the native control on that OS using native methods, (Eclipse / WindowsAppSDK via VS), then author the necessary Maui view, handlers, and copy the native code into the framework project. This allowed me to further understand how the control is supposed to react in the native environment and help understand where the issues are on the .NET Maui side.
Observation #2: The majority of useful code, classes / extensions / platform conversions, are marked private or internal. Heck, even some of the event argument classes are internal!!! On one hand, this lends itself to ALOT of code duplication, but on the other hand, insight into the architecture of .NET Maui and potential streamlining of code use.
For instance, I wanted to implement navigation transitions on Android... I had to create the StackNavigationManager, NavigationViewFragment, NavigationContext, and NavHostFragment because the transition was hardcoded in an override in the NavigationViewFragment. In the videos below, you will see it working for both Windows and Android. Note: the toolbar (NavigationBar) is my own and 100% customizable.
Alot has been posted about the "viability" of basic controls in regard to the OS targeted. My issues are primarily in the Windows "WinUI3" implementation, or lack thereof, fully understanding that the WindowsAppSDK was in existence merely 6 months prior to .NET 6 Maui GA.
I have authored 20+ controls to date in my framework... Why? because I need to harness the performance of the native implementation and remove the multiple layers of indirection in between.
It was apparent to me that a working CarouselView is not in the cards for WinUI / .NET8 Maui... So I wrote one that works using the methods I stated above. Identifying the native control(s), author in that native OS first, then copy the code to my framework...
MauiViewPager - Windows (left) and Android (right)
Custom.CarouselView.mp4
Properties to be implemented later: Loop and PeekAreaInsets
New Properties: OffscreenPageLimit, RemainingItemsThreshold (with Commands to Virtualize), ShowPageButtons, TransitionType
MauiTabView - Windows (left) and Android (right) Implements MauiViewPager
Custom.CarouselView.TabView.mp4
MauiWheelView - Windows (left) and Android (right)
Android Canvas / WinUI3 CanvasControl, ElementComposition and CompositeTransform3D / Looping implemented!
MauiWheelView.mp4
I would have liked to use the new ItemsView in WindowsAppSDK 1.4, but adding it to my project caused the Maui Windows Picker (Combobox) to crash upon dropdown creation. Hopefully WindowsAppSDK 1.4 will be part of the .NET8 Maui GA!!
Final Observation: Alot of hard work has been put into .NET Maui to date and I appreciate and thank the team!
Beta Was this translation helpful? Give feedback.
All reactions