Using existing WinUI controls with Maui for cross-platform desktop apps #1308
Replies: 3 comments 10 replies
-
@praneetloke the question you pose is pretty broad, and potentially open to a certain amount of subjective opinion here, but I'll try to help give you some info that may help you understand this a bit better from a high level. WPF & UWP are pretty tightly coupled Windows application development frameworks. UWP in particular not only requires the user to be on Windows 10 but on a new enough service release to what you've built for. One of the chief benefits to something like WinUI for those developers in the WPF/UWP world is that it really lets the frameworks introduce new things where they may not have been able to previously due to limitations caused by the tighter coupling with the OS. Without getting into the weeds here... WinUI by itself still is going to constrain you desktop development for Windows. Maui on the other hand is the evolution of Xamarin.Forms. The code base is largely based (and started from) Xamarin.Forms 5. This means that you have an application framework for building Native Apps. You ultimately have the ability here to get into very platform specific code as much or as little as you want/need. For example you could simply only ever care about the Maui abstracted control of a Label, however you could interact directly with the underlying UILabel on iOS or the TextView on Android. Where perhaps some confusion may be coming from may be the Experimental Mobile Blazor Bindings. It's perhaps certain models of this where you are truly utilizing WebUI within the Maui app where I think your comparison to Electron is most accurate. As a consultant in this space I would be extremely unlikely to suggest this or give a client any guidance besides rip it out of your code. However I do understand that if you already have skills with Blazor this is likely a very appealing way to bring your skills over to be able to see code you wrote running outside of a Browser on Desktop and Mobile. |
Beta Was this translation helpful? Give feedback.
-
This is how i would explain it (I was writing it but cannot found a answer to one of you're question)
Maui has nothinks to do with electron. Electron offer a way to pack WebUI into desktop application. It can be back by many language since but mostly web language and no native control (It's not impossible to do but it's not the goal).
Some part to understand :
You can do webview in maui if you want (See my MAUI + Blazor comment).
I'm not sure i understand what this mean
You say you don't know but you seem to have already done you're judgement.
For your main question. I'm sorry i don't know. For what you can do with each :
|
Beta Was this translation helpful? Give feedback.
-
After trying many things with Uno too, I decided to give up on using C# for cross-platform native desktop apps for the time being. The platform maturity and tooling just isn't good enough for my taste. Maybe once Maui has had a year or two out in the wild, it could be a formidable cross-platform desktop framework. For now, I just can't see anything better than using Electron that is a complete package for developing cross-platform desktop apps. It's a shame Uno didn't work out for me because it actually does work the way I thought Maui would. Maybe one day Maui would replace Uno. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Disclaimer: I am a newbie when it comes to Windows desktop app development. I know nothing about UWP, WPF, WinUI. They are all just acronyms to me.
As the title states, I am looking for clarification on what, as a developer, can I do with this platform? I was assuming that it was the Electron-equivalent for the dotnet world but without embbeded webview being the renderer and instead, the app would run native to the respective platform using any control from the WinUI library. Instead, it seems that that is not true (at least that last part)? For instance, I was thinking I could use any control from the WinUI3 library and it would "just" work the same way regardless of the platform, but that doesn't seem to be the case? For example, I tried using a
NavigationView
and other controls showcased in the WinUI3 gallery app but VS (VS 2019 Community 16.11 Preview 1) can't find any of those controls. Is this just a limitation of the preview right now and the plan is to support all controls from the WinUI library for all platforms? Or am I grossly misunderstanding how this all works?FWIW, I read the FAQs in this repo and it seems most, if not all, questions are geared towards developers who are well-aware of the development ecosystem surrounding UWP, Xamarin.Forms, WinUI, WPF etc. I have zero experience working with those. I am sort of thinking that Electron is still truly the best cross-platform desktop platform out there, even though it uses an embedded webview-based rendering and there are some cons related to its use of embedded webviews and the packaging mechanism. But at least it "just" works.
Beta Was this translation helpful? Give feedback.
All reactions