Interested in a private company training? Request it here.
Blazor empowers developers to construct any type of application, ranging from static websites (akin to ASP.NET MVC) to highly interactive Single Page Applications, as well as desktop and mobile applications. Blazor truly has it all! In this overview, we'll take a high-level look at the features Blazor offers for building the websites of the future!
In modern web development, we construct applications from components, which, in turn, are often composed of smaller components. A Blazor component is a self-contained segment of the user interface, designed with a single responsibility. Blazor components, crafted from Razor and C#, offer ease of understanding, debugging, and maintenance. Naturally, these components can be reused across different pages, enhancing development efficiency.
Modern web applications frequently adopt the Model-View-ViewModel (MVVM) approach, underscoring the critical role of data binding. Blazor aligns seamlessly with this trend! In the upcoming chapter, we will delve into the diverse methods of data binding that Blazor offers.
Most applications require users to input data. But how do we present this information to the users, capture any changes they make, and validate the data?
Blazor components are created, undergo changes, and are eventually removed. In this section, we will explore the points within a component's lifecycle where you can intercept and interact with these stages.
Blazor components are the foundational elements for building websites. But how can you create components that are truly reusable? And what considerations should be made for performance?
What components are included with Blazor out-of-the-box? Is it possible to dynamically select components for use? Furthermore, does Blazor offer a component for displaying a data table that supports sorting and filtering? It's worth noting that we will focus on components not discussed elsewhere.
You can easily distribute your components as a component library, enabling their use across multiple Blazor projects. Additionally, we will explore developing for both Blazor platforms with the capability to use advanced debugging features.
Dependency Inversion is a foundational principle of sound Object-Oriented design, with Dependency Injection serving as its crucial facilitator. In this chapter, we will delve into both dependency inversion and injection, exploring their essential roles in Blazor architecture. We will demonstrate these concepts by developing a service that abstracts the processes of data retrieval and storage. Such services are pivotal in enabling components to operate efficiently both on the server and in WebAssembly (WASM).
So, how do you communicate with a REST service using Blazor? We'll employ the HttpClient class, which you're likely familiar with from other .NET projects, albeit with a twist.
Blazor is a .NET framework that enables the creation of Single Page Applications (SPAs), similar to how popular JavaScript frameworks like Angular, React, and Vue.js are used. But what exactly is a SPA? We will explore how routing allows us to navigate between different sections of an SPA and how data can be shared among various components.
Sometimes, there's simply no avoiding JavaScript 😊. For instance, Blazor utilizes JavaScript to update the browser's Document Object Model (DOM) from within your Blazor components—and you can do the same. In this chapter, we'll delve into interoperability with JavaScript. As a practical example, we will construct a Blazor Component Library designed to display geographic maps.
A confusing part of Blazor are the different render modes. In short: a component can be interactive or static. This chapter gives an detailed overview of all the render modes, how to set a render mode and how to inspect which render mode is being used. We also look at the process of prerendering, which can improve Search Engine Optimization (SEO), and its implications.
You build a cool Blazor component for your website, NICE! But now you want to also use it in a mobile or desktop application. With Blazor Hybrid, you can use Blazor coponents in .NET MAUI, WPF and WinForms. It is also possible to add a Blazor Component in a MVC view. This chapter is an overview of how Razor components can be used in other parts of the .NET world.
How does Blazor WebAssembly manage state, and how can we prevent losing this state when a user accidentally refreshes the browser? Additionally, we will explore Redux, a pattern that helps manage the complexity of large applications..
Unit testing is viewed by many companies as a fundamental approach to building stable software. Let’s explore this concept and see how we can unit test our Blazor components?
We are not always going to make websites for everyone. We want to make parts of the application saeled. For this we can use authorization in Blazor. But before we can decide what you can or cannot see we need to know the identity of the user, which is called authentication. In this chapter we look at how we can use authentication and authorization in Blazor, we look at the differences between Blazor Server and Blazor WASM and we briefly talk about OpenID Connect in Blazor.
Enough of all this localhost development. We want to go into production! But how do we do this?
‘Full stack development’ encompasses the practice of engaging with every layer of technology stacks in software development, typically involving both front-end and back-end tasks. Microsoft Blazor, a framework by Microsoft, facilitates the creation of modern applications across various platforms, including web, single page, mobile, and desktop. Blazor uniquely enables the use of C#, leveraging the skills and tools familiar to .NET developers. Consider attending this training to gain an early advantage in mastering Blazor. All examples and labs are based on the latest Long-Term Support (LTS) version of .NET and Visual Studio.
This training requires a solid understanding of C# and recommends basic knowledge of HTML and CSS.