. NET MAUI Cross-Platform Application Development Build High-Performance Apps for Android, IOS, MacOS, and Windows Using XAML and Blazor With . NET 8
An evolution of Xamarin.Forms, .NET MAUI is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. Using .NET MAUI, you can develop apps that’ll run on Android, iOS, macOS, and Windows from a single shared codebase. In this revised edition of .NET MAUI Cross-Platfor...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing
[2024]
|
Edición: | Second edition |
Colección: | Expert insight.
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009809016106719 |
Tabla de Contenidos:
- Intro
- Copyright
- Contributors
- Table of Contents
- Preface
- Part 1: Exploring .NET MAUI
- Chapter 1: Getting Started with .NET MAUI
- Overview of cross-platform and full stack technologies
- Native application
- Web application
- Backend services
- Managing development complexity
- Full stack development
- Cross-platform technologies
- Apache Cordova
- Ionic
- React Native
- Flutter
- .NET MAUI
- Analysis of cross-platform full stack solutions
- Comparison of .NET and JavaScript
- Exploring the .NET landscape
- .NET Framework
- Mono
- .NET Core
- .NET Standard and Portable Class Libraries
- Using Xamarin for cross-platform development
- Xamarin.Forms
- Xamarin.Essentials
- Comparing user interface design on different platforms
- Moving to .NET MAUI
- .NET MAUI Blazor apps
- Developing native apps using .NET
- What's new in .NET 8 for .NET MAUI?
- Native AOT support for iOS-like platforms
- .NET MAUI extension of Visual Studio Code
- Development environment setup
- Using Visual Studio
- Installing .NET MAUI on Windows
- Installing .NET MAUI on macOS
- Visual Studio Code with the .NET MAUI extension
- Summary
- Further reading
- Chapter 2: Building Our First .NET MAUI App
- Technical requirements
- Managing the source code in this book
- Download the source code in a compressed file
- Clone the source code per chapter
- Clone the source code from the main branch
- Setting up a new .NET MAUI project
- Creating a new project using Visual Studio
- Creating a new project using the dotnet command
- App startup and lifecycle
- Lifecycle management
- Subscribing to the Window lifecycle events
- Consuming the lifecycle override methods
- Configuring the resources
- App icon
- Splash screen
- Setting custom font icons
- Custom font setup
- Displaying font icons
- Building and debugging.
- Windows
- Android
- iOS and macOS
- Building and testing the iOS target
- Building and testing the macOS target
- Migrating from Xamarin
- Migrating and reusing the Shell template from Xamarin.Forms
- Visual Studio project template
- Summary
- Chapter 3: User Interface Design with XAML
- Technical requirements
- Creating a XAML page
- XAML syntax
- XML declaration
- Element
- Attribute
- XML and XAML namespaces
- Creating a new page using XAML
- Creating the same new page using C#
- XAML markup extensions
- Building a user interface
- Layouts
- StackLayout
- Grid
- FlexLayout
- AbsoluteLayout
- Views
- Label
- Image
- Editor
- Entry
- ListView
- Master-detail UI design
- Side-by-side
- Stacked
- Navigation in the master-detail UI design
- ItemDetailPage
- ItemsPage
- Supporting multiple languages - localization
- Creating a .resx file
- Localizing text
- Summary
- Further reading
- Chapter 4: Exploring MVVM and Data Binding
- Technical requirements
- Understanding MVVM and MVC
- MVVM in PassXYZ.Vault
- Data binding
- Binding object
- Binding target
- Binding source
- Properties of a Binding object
- Source
- Binding mode
- Changing notifications in ViewModels
- .NET Community Toolkit
- How to use the MVVM Toolkit
- Improving the data model and service
- KPCLib
- Abstraction of PwGroup and PwEntry
- PassXYZLib
- Updating the model
- Updating the service
- Binding to collections
- Using custom views
- Summary
- Further reading
- Chapter 5: Navigation Using .NET MAUI Shell and NavigationPage
- Technical requirements
- Implementing navigation
- INavigation interface and NavigationPage
- Using the navigation stack
- Manipulating the navigation stack
- Inserting a page
- Removing a page
- Using Shell
- Flyout
- Flyout items
- Menu items
- Tabs
- Shell navigation.
- Registering absolute routes
- Registering relative routes
- Passing data to pages
- Improving our app
- Understanding the improved design
- Registering absolute routes and relative routes
- Model and services
- Implementation of IUserService
- Improving the login process
- Login view model
- Login UI
- Summary
- Chapter 6: Software Design with Dependency Injection
- Technical requirements
- A brief overview of design principles
- Exploring types of design principles
- Don't Repeat Yourself (DRY)
- Keep It Simple, Stupid (KISS)
- You Aren't Gonna Need It (YAGNI)
- SOLID design principles
- Using design principles
- Implementing DI
- Lifetime management
- Configuring DI in .NET MAUI
- Constructor injection
- Method injection
- Property injection
- Replacing the mock data store
- Initializing the database
- Performing CRUD operations
- Adding an item
- Editing or deleting an item
- Summary
- Further reading
- Chapter 7: Using Platform-Specific Features
- Technical requirements
- Implementing platform-specific code
- Conditional compilation
- Interfaces, partial class, and methods
- .NET MAUI/Xamarin plugins
- The evolution of .NET MAUI/Xamarin plugins
- The introduction of Plugin.Fingerprint
- Supporting fingerprint functionality using Plugin.Fingerprint
- Fingerprint settings
- Login using a fingerprint
- Customizing controls
- Overview of handlers
- Using HybridWebView
- Implementing MarkdownView
- Summary
- Further reading
- Part 2: Implementing .NET MAUI Blazor
- Chapter 8: Introducing Blazor Hybrid App Development
- Technical requirements
- What is Blazor?
- Hosting models
- Blazor Server
- Blazor Wasm
- Blazor Hybrid
- Blazor Bindings
- What's new in .NET 8 Blazor hosting models
- Project templates of .NET MAUI and Blazor apps
- Blazor apps
- .NET MAUI apps.
- Creating a new .NET MAUI Blazor project
- Generating a .NET MAUI Blazor project with the dotnet command line
- Creating a .NET MAUI Blazor Hybrid App using Visual Studio on Windows
- Running the new project
- The startup code of the .NET MAUI Blazor Hybrid App
- Migrating to a .NET MAUI Blazor Hybrid App
- Understanding Razor syntax
- Code blocks in Razor
- Implicit Razor expressions
- Explicit Razor expressions
- Expression encoding
- Directives
- Directive attributes
- Creating a Razor component
- Redesigning the login page using a Razor component
- The Model-View-ViewModel (MVVM) pattern in Blazor
- Dependency injection in Blazor
- CSS isolation
- Summary
- Further reading
- Chapter 9: Understanding Blazor Routing and Layout
- Technical requirements
- Understanding client-side routing
- Setting up BlazorWebView
- Setting up the Router component
- Defining routes
- Passing data using route parameters
- Navigating with NavigationManager
- Using Blazor layout components
- Applying a layout to a component
- Nesting layouts
- Implementing navigation elements
- Implementing a list view
- Adding a new item and navigating back
- Summary
- Chapter 10: Implementing Razor Components
- Technical requirements
- Understanding Razor components
- Inheritance
- Creating a Razor class library
- Using static assets in the Razor class library
- Creating reusable Razor components
- Creating a base modal dialog component
- Data binding
- Component parameters
- Nested components
- Child content rendering
- Two-way data binding
- Binding with component parameters
- Communicating with cascading values and parameters
- Understanding the Razor component lifecycle
- SetParametersAsync
- OnInitialized and OnInitializedAsync
- OnParametersSet and OnParametersSetAsync
- ShouldRender
- OnAfterRender and OnAfterRenderAsync.
- Implementing CRUD operations
- CRUD operations of items
- Adding a new item
- Editing or deleting an item
- CRUD operations of fields
- Refactoring Razor components
- Creating the Navbar component
- Creating a Dropdown component for the context menu
- Using templated components
- Creating a ListView component
- Using the ListView component
- Accessing a native API from Blazor Hybrid apps
- Summary
- Part 3: Testing and Deployment
- Chapter 11: Developing Unit Tests
- Technical requirements
- Unit testing in .NET
- Setting up the unit test project
- Developing test cases for the model
- Sharing context between tests
- Sharing using a constructor
- Sharing using class fixtures
- Sharing using collection fixtures
- Mock .NET MAUI components
- Razor component testing using bUnit
- Changing the project configuration for bUnit
- Creating a bUnit test case
- Creating test cases in Razor files
- Using the RenderFragment delegate
- Testing Razor pages
- Summary
- Further reading
- Chapter 12: Deploying and Publishing in App Stores
- Technical requirements
- Preparing application packages for publishing
- Preparing for publishing
- Publishing to Microsoft Store
- Publishing to Google Play Store
- Publishing to Apple's App Store
- GitHub Actions
- Understanding GitHub Actions
- Workflows
- Events
- Jobs
- Runners
- Steps
- Summary
- Further reading
- Other Books You May Enjoy
- Index.