Posts

Showing posts with the label Blazor Hybrid
Image
  Blazor Hybrid is an appealing option when you want a native Windows application without giving up Razor components, HTML, CSS, and the web UI development model. To explore that combination, I built a WPF application with four tabs: Home, Counter, Weather, and Batman Villains. The Counter and Weather pages began with the familiar Blazor template examples. The more interesting parts are the Home page, which became a two-column Batman villains threat board, and the Batman Villains page, which provides a reorderable watch list. Both pages support drag and drop inside a WPF-hosted WebView. This post briefly covers the hybrid infrastructure, then focuses on how the routed tabs and drag-and-drop UI work. The Hybrid Foundation The application is a WPF executable that hosts Razor components through BlazorWebView. There is no separate web server. WPF owns the desktop window and application lifetime, while Blazor renders the interface inside the embedded WebView2 browser control. The host w...

Maui Hybrid application and a Blazor

Image
Since Java first came out, I have been trying to use the same code for both a desktop client and a web client. It was easy to do this for the backend. Getting a shared UI across a desktop and a web client that provided the same experience, was not possible.  Add in the support for Android and iOS and you end up with 4 UI code bases, 4 UI teams, 4 QA teams, etc. Maui Blazor Hybrid to the rescued. With Maui Blaozr I can finally achieve that goal. In my last post, "Let’s Make a Blazor Hybrid Application!" I showed how to create a simple Maui Blazor hybrid application.  I now took the next step, added a Blazor Web Assembly application, and using the Shared library, I created a hosted web client and a desktop client, with the same UI. Here is how I did it. Desktop Application Create a Share UI library project Move the Pages Folder into the new library Move the Shared Folder into the new library Move the CSS folder into the new library Create a new Shared Service Library Move the W...

Let’s Make a Blazor hybrid Application!

Image
    Maui has been out for a while now and I thought I would learn how to create a Blazor hybrid application and see what it is about.   There are blog posts and YouTube videos on how to do this so, see the links below. I am not focusing on the step-by-step but on what I learned by doing this exercise. It will help others.   Prep Work           You will need to make sure you have the Maui project templates installed in Visual Studio.           Go to the VS installer.         a.      Click the modified button.          Make sure under the Desktop and UI Development the .Net Multi-platform App UI development is checked, see image.        If not check it and click modify to install it.     Create the Project 1.      Open Visual Studio and click on “Create new Proj...