spiegelp / MaterialDesignExtensions

Material Design Extensions is based on Material Design in XAML Toolkit to provide additional controls and features for WPF apps
https://spiegelp.github.io/MaterialDesignExtensions/
MIT License
762 stars 122 forks source link

Remove a tabItem from tabControl shows a binding error #131

Closed beefsteak closed 3 years ago

beefsteak commented 3 years ago

image image image Cannot find source for binding,I guess it's a style problem.

spiegelp commented 3 years ago

@beefsteak Removing a tab causes a recalculation of the bindings but the parent TabControl is not available anymore for the tab item. That is more a problem of WPF than MaterialDesignExtensions. You might add the following code before the Clear() call:

foreach (object item in Tab.Items)
{
    ((TabItem)item).Template = null;
}