How to use vCurrent and “self” correctly in viewmodels

A simple mistake can mess up your viewmodel rendering and make it slow and not what you expected. Let me explain!

This is our example model, which lends itself to a simple master-detail view.

Simple Model vCurrent.png

The view we want is a list of Years, click a Year, and that Year’s months will show. Then, click a Month and that month’s Days will show.

Below is the different viewmodels which will show the same thing.

Different View Models.pngDifferent View Models 2.pngDifferent View Models 3.png

This page was edited 78 days ago on 01/11/2024. What links here