Posts about MVVM

Avoid async calls in view model constructors

October 21st 2022 MVVM .NET MAUI

The view models in the MVVM pattern are responsible for providing data for the view. It may be tempting to load the data in the constructor of the view model. But if the methods to load the data are asynchronous, they must then be called in a blocking manner. Even if we ignore the danger of deadlock, this is not a good idea.

Dangers of a hidden PropertyChanged event

August 19th 2022 C# MVVM Xamarin

I recently spent a considerable amount of time looking for a reason why the data binding in one of the Xamarin.Forms pages was not working. When I found the cause, it made perfect sense. But it was not easy to identify it.

Book Review: Enterprise Application Patterns Using Xamarin.Forms

May 29th 2020 Xamarin MVVM Book Review

The Enterprise Application Patterns using Xamarin.Forms book by David Britch is available as a free download on the Microsoft's .NET Architecture Guides website. It's a good introduction to MVVM. It can also serve as a refresher for someone with past MVVM experience who hasn't worked with Xamarin.Forms before. Although the sample code uses Xamarin.Forms, it's almost just as useful to WPF and UWP developers.

Binding to Individual Dictionary Items in WinRT

June 30th 2014 Binding Windows Store MVVM

XAML has first class syntax support for binding to indexed properties, such as Dictionary. Real properties still have their advantages over indexed ones, such as full support for implementing INotifyPropertyChanged. For Dictionary properties this can only be done for all items in the collection at once. Unfortunately, in Windows Store applications this causes problems when there are bindings to keys that are not present in the new Dictionary.

Slides and Demos from a Local Windows 8.1 Development Event

March 3rd 2014 MVVM Windows Store Speaking

Last Tuesday the local Microsoft DPE team organized a free event for developers thinking about taking part in the regional Windows 8.1 Developers Contest. It was planned as an effective course for developers not having previous experience with development of Windows Store apps. I presented two sessions at the event.

A Working Sample Application with Infinite Scrolling for Windows Phone 8

September 9th 2013 Windows Phone MVVM

Some time ago I published a blog post describing how to handle incremental loading in scrolling lists with large amount of data on Windows Phone 8. After receiving an email asking me for a working solution, I decided to publish it and make it available to everyone, instead of sending it by email.

Infinite Scrolling with Incremental Loading in Windows Phone 8

March 17th 2013 Windows Phone MVVM

In mobile applications there's often a need for scrolling lists with large or even (for all practical purposes) infinite amounts of data which of course needs to be loaded incrementally. This can be achieved in pure MVVM fashion with LongListSelector control.

Developing Windows Store Apps with C#, XAML and MVVM Session from Bleeding Edge 2012

October 25th 2012 MVVM Windows Store Speaking

The 5th Bleeding Edge conference was taking place in Laško. For my session I decided to take a different approach to the development of Windows Store apps: instead of talking about the design or the available APIs in WinRT, I focused on architectural best practices when using C#, XAML and the MVVM pattern.