|
Do not hit 'reply' to this email: To reply, click here.
Gautier Boder has posted a new comment at "Article "WPF: If Heineken did MVVM Frameworks Part 6 of n"":
Hi,
We're trying to use yourTabControlEx
within our application in cohabitation with the MVVM pattern but instead of having it within aWindow
element we declared it within anUserControl
element. The result is that the first displayed tab (the one added on the application's startup) is selected but has no content shown.
If you look at the visual tree (using snoop) the ContentPresenter that should be showing the view matching the selected workspace viewmodel just doesn't exists at all. TheGrid
has no children.
Digging further into the implementation of yourTabControlEx
we've found that when you reside within aWindow
first the data binding is done and the only the template is applied. Being within anUserControl
works exactly the opposite, first the template is applied and then only the DataBinding is done.
This cause the template to be applied with an empty Items collection at this point of time.
We don't know if this could cause the problem of my "empty" tab as when we're using the nativeTabControl
control directly also in combination with MVVM,DataTemplate
andViewModel
it works ... Weirdo isn't ? Do Microsoft have a really hidden logic within its control that isn't called just by calling the base constructor? Or is their some hidden events that we're not able to overload or handle when overwriting the control?
Any thoughts or digging way would be really appreciated.
Thanks to anyone who used this TabControlEx to post their feedback.
Gautier