I have multiple window files and i want to merge my Xaml files(window) into a Tab control in a MVVM Pattern. Each item Tab will represents a Xaml file. i need something like this:
<TabControl >
<TabItem>
<local:FirstView></local:FirstView>
</TabItem>
<TabItem>
<local:SecondView></local:SecondView>
</TabItem>
</TabControl>
but i get this Error:
"Window must be the root of the tree. Cannot add Window as a child of Visual."
I have seen many topics like this but they use user control or they use a single view with multiple View Model.
Is there any way to import window(xaml) into tab control?
And another important thing, i want to have a button like Cancel, Pushing Cancel means we have to go back one level(go to another tab Item). view model is not aware of view, so how can i navigate through them?