Using a tabbed interface with MVVM

A common scenario in WPF is to use a tabbed interface to give the user the option to use multiple main views in a tabbed environment. This example shows how to implement this correctly with both closable and non-closable tabs.

For this example, we will have a few requirements:

Be able to add, close and activate tabs via a service

Be able to specify whether a tab can be closed by the end-user

Creating the model describing a tab item

First of all, we need a model describing a tab item so we can interact with a service. We want the tab to be closeable via the service, but also via the view model it is representing.