KeyNotFoundException is thrown when the LayoutControl is deserialized and the serialization string contains a LayoutControlTabGroupItem.
You can try to work this around by using the RadPersistenceFramework.
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();
}
}
LayoutControl with at least one child - for example a button. Show such LayoutControl in usercontrol, then unload it from visual tree. Try Forcing GC.Collect() Observation: LayoutControl stays in memory. Expected: LayoutControl should not stay in memory.
Multiple LayoutControl instances with LayoutControlToolBox share single ToolBoxView instance. This makes the ToolBoxView useless because it indicates wrong structure of foreign LayoutControl. Workaround is to instantiate the ToolBoxViews manually: <telerik:RadLayoutControl.AdditionalCanvasItems> <telerik:LayoutControlToolBox LayoutControl="{Binding ElementName=layoutControl4}" > <telerik:LayoutControlToolBox.ToolBoxView> <telerik:LayoutControlToolBoxView /> </telerik:LayoutControlToolBox.ToolBoxView> </telerik:LayoutControlToolBox> </telerik:RadLayoutControl.AdditionalCanvasItems> By default they are instantiated internally.
FlowDocument (or other non-FrameworkElement) is used in LayoutControl. When you move the mouse over the control - InvalidCastException is thrown. You can test also with MS RichTextBox. Available in R2 2017 Release