This repository contains examples for the book published by Packt:
Make sure your .NET MAUI environment is set up according to the official guide: .NET MAUI Installation. Some examples also include an ASP.NET Core service, so ensure you have the necessary workloads installed: ASP.NET Core Prerequisites.
Additionally, it's recommended to move the downloaded folder closer to the root directory to avoid errors caused by long file paths.
- Crafting the Page Layout
- Mastering the MVVM Design Pattern
- Decoupling the UI from the view model
- Implementing auto-generated view models
- Implementing asynchronous commands
- Initializing bound collections without freezing the UI
- Interacting with the UI from the view model without breaking MVVM
- Sending messages between view models via different channels
- Injecting an application service into a view model using dependency injection
- Troubleshooting binding errors
- Advanced XAML and UI Techniques
- Extending a UI element without subclassing using attached properties
- Implementing attached behavior to reuse UI logic
- Implementing ContentView with dependency properties to reuse UI elements
- Assigning custom animations to elements in XAML
- Creating motion graphics with Lottie animations
- Implementing dark/light theme switching
- Implementing theme support for images and the status bar
- Drawing custom elements on a canvas
- Connect to a Database and Implement CRUD Operations
- Connecting to a local SQLite database via Entity Framework Core
- Implementing create and delete operations
- Implementing detail and edit forms
- Implementing the unit of work and repository patterns
- Handling errors while saving data to a database
- Validating editors in the UI before data posting
- Implementing data caching for enhanced performance
- Connecting to a remote Web API service
- Authentication & Authorization
- Creating an authentication service with ASP.NET Core Identity
- Building a client application connected to the authentication service
- Implementing role-based access rules on the server
- Accessing endpoints with role-based access in the client application
- Signing in with a Google account
- Managing secured sessions
- Implementing biometric authentication
- Real-Life Scenarios: AI, SignalR, and More
- Creating an AI assistant that enhances text with OpenAI
- Building a chat bot with Ollama deployed to a self-hosted server
- Detecting a face on an image with a local ONNX model deployed to the device
- Sending real-time updates from the server using SignalR
- Uploading large files in chunks to a server
- Sending local push notifications
- Synchronizing data between the offline and online databases
- Understanding Platform-Specific APIs and Custom Handlers
- Optimizing Performance
Think about how much time you usually spend building an app in a technology you're still mastering. It often involves grasping new concepts, navigating roadblocks, and even rewriting entire modules as your understanding deepens. This book is designed to save you that time, guiding you toward creating a modern .NET MAUI application with expert-level quality. It addresses a wide range of essential tasks and concepts needed for real-world apps, including UI best practices and advanced tips, MVVM, dependency injection, performance and memory profiling. Since real applications often go beyond frontend development, this book also explores integration with backend services for authentication, data processing, synchronization, and real-time updates. Additionally, you’ll learn to implement multiple AI integration strategies - no prior machine learning experience required.
Mastery comes with practice, so the book is organized with step-by-step recipes, each tackling a specific task. Each recipe includes detailed explanations to help you apply the knowledge to your own unique projects.
By the end, you'll have the skills to build high-performance, interactive cross-platform applications with .NET MAUI - saving valuable time on your next projects.
- Discover effective techniques for creating robust, adaptive layouts
- Leverage MVVM, DI, cached repository and unit of work patterns
- Implement CRUD forms with validation, local and remote databases
- Integrate authentication with a self-hosted service and Google OAuth
- Incorporate session management and role-based data access
- Tackle real-time updates, chunked file uploads and offline data mode
- Explore AI integration strategies: from local device to cloud models
- Master techniques to empower your app with platform-specific APIs
- Identify and eliminate performance and memory issues
This book is primarily aimed at developers who are already familiar with the basics of .NET MAUI. Whether you're actively building a .NET MAUI app or just starting to plan one, this guide will help you develop more efficiently and with better quality. Inside, you'll discover advanced techniques and practical examples to enhance your skills and tackle real-world development challenges.
While a basic understanding of .NET MAUI and XAML is assumed, the recipes are presented in a simple, step-by-step format, making them easy to follow, even without prior experience. The only requirement is having your development environment set up, including Visual Studio or VS Code, .NET MAUI workloads, and an emulator or device for debugging.