I want to encapsulate a view/viewmodel into another view/viewmodel. The aim is to have a popup, slide panel or whatever you can think of common behaviour and insert a custom view/viewmodel into it.

I want to use the generic for doing that but I'm kind of stuck

the parent view model will look like that

```
public class SidePanelViewModel<T>
{
    public SidePanelViewModel(T enclosedViewModel)
    {
        EnclosedViewModel = enclosedViewModel;
    }

    public T EnclosedViewModel { get; private set; }
}

```

The parent view will be like that

```
... whatever design and behavior ...
<ContentPresenter Content="{Binding EnclosedViewModel}"/>
... whatever design and behavior ...

```

In my mapping file I would like to put that but here is the problem:

```
<DataTemplate DataType="{x:Type WPFTests:SidePanelViewModel}">
  <WPFTests:SidePanelView />
</DataTemplate> 

<DataTemplate DataType="{x:Type WPFTests:EnclosedViewModel}">
  <WPFTests:EnclosedView />
</DataTemplate>

```

This does not work because the constructor of the viewmodel SidePanelViewModel requiere a type to be created.

I guess what I want to do is having a view/viewmodel inherit from another view/viewmodel 

Hope someone can help on that