Business logic represents a real-world problem in code: its objects, rules, processes, decisions, and operations. It is different from UI logic and presentation logic, which control appearance, behavior, and screen state. section 9.3
In a .NET MAUI application, business logic can include:
- Models representing real-world objects, such as products, users, or cars, together with operations that change their state. section 9.3
- Rules for processing user input and methods that query a database or API using specific criteria. section 9.3
- Services that provide reusable application functionality instead of placing that logic in XAML page code-behind files. section 8.1
MauiStockTake inventory workflow
The View handles controls, while the ViewModel exposes commands and state. A ProductService searches for products, and an InventoryService sends the submitted stock count to an API. Product and stock-count models hold domain data. This arrangement lets the UI change independently from the business logic and permits the API implementation to change without rewriting the rest of the app. section 9.5 section 9.6
Figure 9.3 With the MVVM pattern, UI logic, which includes layouts and UI behavior like animation and text formatting, belongs in the View. Presentation logic, which includes the UI state such as the values of properties in the UI and logic for responding to user actions, belongs in the ViewModel. Business logic, such as rules for processing user input, or communicating with an API, belongs in the Model.
Use the MVVM separation diagram to distinguish business logic in the Model from presentation logic in the ViewModel and UI logic in the View. section 9.3









