Replies: 3 comments 24 replies
-
Yes, it's possible to implement. Furthermore, it should already work with no issues on Windows, where you can combine our NativeControlHost with WPF/WinForms BlazorWebView component. Similarly how I did it for the usual WebView component in Avalonia using native browser view - https://github.com/maxkatz6/AvaloniaWebView. It's definitely possible to port other platforms in similar way, like they did for MAUI dotnet/maui#654. Especially when Avalonia now supports native controls for mobile platforms in nightly builds, so it's possible to use native webkit for both android and ios. Saying that, it's should be an interesting project, but it can't fit in the scope of our current release. And I am not sure if it's something that should be available as first class control in the Avalonia repository. Saying that, if community wants to implement that and maintain as an third party library, we can help with information how it should be implemented. |
Beta Was this translation helpful? Give feedback.
-
Note that a lot of this work is just implementing a WebView for Avalonia that works cross platform. This is definitely something Avalonia needs as a 1st party control in some form to stay competitive. I'm surprised there hasn't been more concern that it is missing. This means I don't necessarily agree that BlazorWebView shouldn't be a "first class control in Avalonia". WebView must be a first class control sooner rather than later. Then once that is done, making a BlazorWebView is quite easy I imagine. When I have time I will be happy to assist in starting a WebView control (@maxkatz6 already did quite some work). It is something that will be needed on my end as well. For mobile platforms it must wrap the native WebViews so we might as well do the same for Desktop. This means it will be much easier to maintain as we don't have to worry about all the details or keeping it up to the latest standards. This will likely be the only control that follows a MAUI-type architecture though. |
Beta Was this translation helpful? Give feedback.
-
your could do it for windows with that #17185 or https://github.com/MicroSugarDeveloperOrg/Avalonia.WebView |
Beta Was this translation helpful? Give feedback.
-
It would be extremely good to be able to write Avalonia Blazor Hybrid aps, just like it is possible with MAUI, WPF and even Winforms
*What is Hybrid app? *
Ms Docs
In general, it is a native app with a specialized web view to handle Blazor. Blazor components are run directly in process (no WASM, no JS), and the view just renders them. I don't know any technical details how to do it.
That way you get great performance (in process Blazor components), low memory usage (the only web layer is rendering), Blazor productivty and cross-platform support due to Avalonia.
I have no idea if this is hard task, but I think many people would prefer to host the Hybrid Blazor app in Avalonia over .NET MAUI if they go cross-platform.
Beta Was this translation helpful? Give feedback.
All reactions