.NET MAUI Cookbook - Alexander Russkov - E-Book

.NET MAUI Cookbook E-Book

Alexander Russkov

0,0
32,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Think about how much time you usually spend building an app in a technology you're still mastering—grasping new concepts, navigating roadblocks, and even rewriting entire modules as you learn. This book saves you that time, helping you create a modern .NET MAUI application like a pro.
The chapters address a wide range of tasks and concepts essential for real-world apps, including UI best practices and advanced tips, MVVM, dependency injection, performance, and memory profiling. Since real-world 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, all without any prior machine learning experience.
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 what you're learning to your own unique projects.
By the end of this book, you'll have developed the skills to build high-performance, interactive cross-platform applications with .NET MAUI, saving valuable time on your future projects.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 348

Veröffentlichungsjahr: 2024

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



.NET MAUI Cookbook

Build a full-featured app swiftly with MVVM, CRUD, AI, authentication, real-time updates, and more

Alexander Russkov

.NET MAUI Cookbook

Copyright © 2024 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

The author acknowledges the use of cutting-edge AI, in this case ChatGPT, with the sole aim of enhancing the language and clarity within the book, thereby ensuring a smooth reading experience for readers. It’s important to note that the content itself has been crafted by the author and edited by a professional publishing team.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Group Product Manager: Rohit Rajkumar

Publishing Product Manager: Tanisha Mehrotra

Book Project Manager: Arul Viveaun S

Senior Editor: Mark D’Souza

Technical Editor: K Bimala Singha

Copy Editor: Safis Editing

Proofreader: Mark D’Souza

Indexer: Manju Arasan

Production Designer: Prashant Ghare

Senior DevRel Marketing Executive: Nivedita Pandey

First published: December 2024

Production reference: 1141124

Published by Packt Publishing Ltd.

Grosvenor House

11 St Paul’s Square

Birmingham

B3 1RB, UK.

ISBN 978-1-83546-112-9

www.packtpub.com

Contributors

About the author

Alexander Russkov is a seasoned software engineer and product manager with over 12 years of experience in the .NET domain and XAML-based technologies. Throughout his career at DevExpress, he has made significant contributions to the .NET MAUI, WPF, and WinForms teams. With a deep understanding of customer needs and project optimization, Alexander offers valuable insights for developers looking to sharpen their cross-platform application skills.

I want to thank my incredible team at DevExpress for inspiring me to push the limits and always aim higher. A heartfelt thanks to my family for their constant support and patience. And to the .NET community and all the developers I’ve learned from – with shared knowledge and collective efforts, we can achieve great things!

About the reviewers

Leela Vardhan Siramdasu is a software developer with experience in .NET technologies and machine learning. His work focuses on building efficient, scalable applications, leveraging advanced C#, Python, ASP.NET, MAUI and related frameworks. Passionate about clean code, he is committed to enhancing the user experience through intuitive and well-structured software solutions. Vardhan has a proven ability to collaborate with teams and deliver projects on time, while continuously seeking to expand his technical expertise and contribute to the tech community.

Lokesh Sehgal has 14 years of experience in the apps and backend development; he brings deep expertise in server-side and frontend technologies, including Azure, AWS, C#, ASP.NET, and microservices. He has got a strong background in frontend programming languages such as C#, Objective-C, SwiftUI, Swift, Java, and Kotlin. His focus is on creating scalable, efficient, and high-performing mobile solutions that integrate seamlessly with robust back-end systems, ensuring optimal user experiences and technical excellence across the full development stack. He is proficient in creating RESTful APIs, managing databases, and implementing efficient data processing workflows.

Table of Contents

Preface

1

Crafting the Page Layout

Technical requirements

Creating horizontal/vertical layouts

Getting ready

How to do it…

How it works…

There’s more…

Creating grid layouts

Getting ready

How to do it…

How it works…

There’s more…

Creating scrollable layouts

Getting ready

How to do it…

How it works…

There’s more…

Implementing device-specific layouts

Getting ready

How to do it…

How it works…

There’s more…

Implementing layouts with dynamic orientation

Getting ready

How to do it…

How it works…

There’s more…

Building a layout dynamically based on a collection

Getting ready

How to do it…

How it works…

There’s more…

Implementing a custom arranging algorithm

Getting ready

How to do it…

How it works…

There’s more…

2

Mastering the MVVM Design Pattern

Technical requirements

Decoupling the UI from the view model

Getting ready

How to do it…

How it works…

There’s more…

Implementing auto-generated view models

Getting ready

How to do it…

How it works…

There’s more…

Implementing asynchronous commands

Getting ready

How to do it…

How it works…

There’s more…

Initializing bound collections without freezing the UI

Getting ready

How to do it…

How it works…

There’s more…

Interacting with the UI from the view model without breaking MVVM

Getting ready

How to do it…

How it works…

There’s more…

Sending messages between view models via different channels

Getting ready

How to do it…

How it works…

There’s more…

Injecting an application service into a view model using dependency injection

Getting ready

How to do it…

How it works…

There’s more…

Troubleshooting binding errors

Getting ready

How to do it…

How it works…

There’s more…

3

Advanced XAML and UI Techniques

Technical requirements

Extending a UI element without subclassing using attached properties

Getting ready

How to do it…

How it works…

There’s more…

Implementing attached behavior to reuse UI logic

Getting ready

How to do it…

How it works…

There’s more…

Implementing ContentView with dependency properties to reuse UI elements

Getting ready

How to do it…

How it works…

There’s more…

Assigning custom animations to elements in XAML

Getting ready

How to do it…

How it works…

There’s more…

Creating motion graphics with Lottie animations

Getting ready

How to do it…

How it works…

There’s more…

Implementing dark/light theme switching

Getting ready

How to do it…

How it works…

There’s more…

Implementing theme support for images and the status bar

Getting ready

How it works…

There’s more…

Drawing custom elements on a canvas

Getting ready

How to do it…

How it works…

There’s more…

4

Connecting to a Database and Implementing CRUD Operations

Technical requirements

Connecting to a local SQLite database via Entity Framework Core

Getting ready

How to do it…

How it works…

There’s more…

Implementing create and delete operations

Getting ready

How to do it…

How it works…

There’s more…

Implementing detail and edit forms

Getting ready

How to do it…

How it works…

There’s more…

Implementing the unit of work and repository patterns

Getting ready

How to do it…

How it works…

There’s more…

Handling errors while saving data to a database

Getting ready

How to do it…

How it works…

There’s more…

Validating editors in the UI before data posting

Getting ready

How to do it…

How it works…

There’s more…

Implementing data caching for enhanced performance

Getting ready

How to do it…

How it works…

There’s more…

Connecting to a remote web API service

Getting ready

How to do it…

How it works…

There’s more…

5

Authentication and Authorization

Technical requirements

Creating an authentication service with ASP.NET Core Identity

Getting ready

How to do it…

How it works…

There’s more…

Building a client application connected to the authentication service

Getting ready

How to do it…

How it works…

There’s more…

Implementing role-based access rules on the server

Getting ready

How to do it…

How it works…

There’s more…

Accessing endpoints with role-based access in the client application

Getting ready

How to do it…

How it works…

Signing in with a Google account

Getting ready

How to do it…

How it works…

There’s more…

Managing secured sessions

Getting ready

How to do it…

How it works…

There’s more…

Implementing biometric authentication

Getting ready

How to do it…

How it works…

There’s more…

6

Real-Life Scenarios: AI, SignalR, and More

Technical requirements

Creating an AI assistant that enhances text with OpenAI

Getting ready

How to do it…

How it works…

There’s more…

Building a chat bot with Ollama deployed to a self-hosted server

Getting ready

How to do it…

How it works…

There’s more…

Detecting with a local ONNX model deployed on the device

Getting ready

How to do it…

How it works…

There’s more…

Sending real-time updates from the server using SignalR

Getting ready

How to do it…

How it works…

There’s more…

Uploading large files in chunks to a server

Getting ready

How to do it…

How it works…

There’s more…

Sending local push notifications

Getting ready

How to do it…

How it works…

There’s more…

Synchronizing data between offline and online databases

Getting ready

How to do it…

How it works…

There’s more…

7

Understanding Platform-Specific APIs and Custom Handlers

Technical requirements

Compiling code based on the target platform

Getting ready

How to do it…

How it works…

There’s more…

Implementing a cross-platform API

Getting ready

How to do it…

How it works…

There’s more…

Customizing a platform view with an existing control handler

Getting ready

How to do it…

How it works…

There’s more…

Creating a custom handler

Getting ready

How to do it…

How it works…

There’s more…

8

Optimizing Performance

Technical requirements

Comparing performance in debug and release configurations

Getting ready

How to do it…

How it works…

There’s more…

Simplifying a collection item template

Getting ready

How to do it…

How it works…

There’s more…

Using images with an optimal size

Getting ready

How to do it…

How it works…

Using compiled bindings

Getting ready

How to do it…

How it works…

Loading data in asynchronous methods

Getting ready

How to do it…

How it works…

Profiling the application

Getting ready

How to do it…

How it works…

There’s more…

Detecting memory leaks

Getting ready

How to do it…

How it works…

There’s more…

Getting rid of memory leaks

Getting ready

How to do it…

How it works…

There’s more…

Index

Other Books You May Enjoy