This is my situation: I have a TabControl and I have replaced its template with my own so that headers of TabItems are displayed inside a Grid thus spreading equally through available space. I put a setter inside a TabItem style whose value is bound to the ancestral Grid (the one mentioned before). I'm using a converter to assign Grid.Row to Grid.Children.IndexOf(TabItem) and in the process adding a RowDefinition to this Grid.
This works fine while adding TabItems (dynamically) but when I remove a TabItem, it doesn't refresh the values. So I figure I need to place a trigger so that every time Grid.Children is changed values get recalculated. I am unsure how to accomplish this.