Approved
Last Updated: 11 Sep 2019 12:28 by ADMIN
Martin Ivanov
Created on: 11 Sep 2019 12:24
Category: LayoutControl
Type: Bug Report
0
LayoutControl: Data bindings are not evaluated when changing between tabs

Properties bound with UpdateSourceTrigger=LostFocus in the content of LayoutControlTabGroupItem are not updated when changing the selected tab. The LostFocus event is fired after the data context of the corresponding element is removed and the issue appears.

To work this around subscribe to the PreviewMouseLeftButtonDown event of LayoutControlTabGroup and Focus the pressed tab (the new selection).

private void LayoutControlTabGroup_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
	var tabContainers = this.layoutTabGroup.ChildrenOfType<LayoutControlTabGroupItem>();
	var tabUndersMouse = tabContainers.FirstOrDefault(x => x.IsMouseOver);
	if (tabUndersMouse != null)
	{
		tabUndersMouse.Focus();
	}
}

0 comments