From the course: Creating .NET MAUI Applications with Blazor
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Razor Class Libraries - .NET MAUI Tutorial
From the course: Creating .NET MAUI Applications with Blazor
Razor Class Libraries
- [Instructor] We've explored one way to handle differences in platform APIs using a .NET 7.0 DLL that we can also use to share business logic. But how about the Razor pages themselves? Can those be shared? The answer is yes with the Razor Class Library. This is a special container for sharing Razor files. To create one, we're going to start by right clicking on our solution and going in and clicking Add, New Project. And we'll search for the word Razor and we want Razor Class Library. And we'll press next and we're going to name it Notes.Library. And press next and we'll select .NET 7.0, which is what we've selected for the other projects and press Create. Now, there's some boilerplate code that we don't need in this library, so I'm going to remove it. So this Component1.razor, we'll delete it. And also under wwroot or wwwroot, there's example.JsInterop, and we'll delete that as well. We also want to make sure that both…
Contents
-
-
-
-
-
A single website to rule them all4m 11s
-
(Locked)
How about native APIs?6m 48s
-
(Locked)
Razor Class Libraries5m 52s
-
(Locked)
Handling UI differences between website and app9m 50s
-
(Locked)
Storing local data: Part 14m 55s
-
(Locked)
Storing local data: Part 29m 49s
-
(Locked)
Issues around keeping your app up to date3m 30s
-
(Locked)
The HTML5 service worker and WebAssembly4m 33s
-
(Locked)
Challenge: Implementing IndexedDB1m 56s
-
(Locked)
Solution: Implementing IndexedDB5m 2s
-
-
-