My tab item is bound to a viewmodel via the content of its contentcontrol
<TabItem>
<ContentControl Content="{Binding MyVm}" />
</TabItem>
View-ViewModel matching set in the resources of my main :
<DataTemplate DataType="{x:Type MyViewmodelType}">
<MyView />
</DataTemplate>
No problems here, binding works.
On my view, i have a behavior which populate the view's control with data fetched somewhere. This assignment is done after the InitializeComponent of my view. My problem is, at this time when my view's data is set, its datacontext is not yet assigned, and the data doesn't go all the way to the datacontext.
When the datacontext get set, the bindings are resolved and all the data already in my view is erased. Of course, i need all my view's properties to be in the Two-Way mode.
How can i keep the view data when resolving the bindings for the first time ?