Build the functional ViewModel before constructing its corresponding view. This approach suits developers who think in functional design, reduces visual-design cognitive load, and lets UI and functionality develop independently. section 9.5.2
Choose the starting point according to the task and team:
- Start with the ViewModel when functional requirements, testable behavior, or service interactions are clearer than the visual design. section 10.3.1
- Start with the view when visual design leads the work, a framework favors that direction, or a UI designer has already supplied the interface. section 9.5.2
- Develop both sides in parallel with MVVM, then connect them through binding and dependency injection. section 9.5.2 section 10.3.1
Build a report page from the ViewModel outward
Create ReportViewModel with an observable inventory collection and an injected inventory service. Add Init to avoid repeated initialization and Refresh to load data, clear and repopulate the collection, and update IsLoading. Register the ViewModel, inject it into ReportPage, assign BindingContext, and call Init from OnAppearing. Add the XAML only afterward, binding the loading indicator and CollectionView to the ViewModel. section 10.3.1
