The following scenario bothers me: I have a simple WPF Window that has a TabControl as content. The ItemsSource of the TabControl is bound to a list of objects. In order to visualize the objects I defined some DataTemplates. As the list of objects may have different types, the right visualization is chosen by the default template selector. This works fine and does not cause any trouble.
The issue that came up is the size of the window. The DataTemplates have different sizes. And I want the dialog to have a size that the largest DataTemplate fits. When I use SizeToContent in the Window, the Window changes its size everytime I change the tabs.
So, my questions is, how can I achieve to make the window fit the largest TabItem (which size is determined by the DataTemplate)?
thanks, Florian