Hello,
I get an error when I try to load a layout which is saved from the last application-session. In the samples-code below I have redruced the code.
If I swap <RadSplitContainer InitialPosition="FloatingDockable"> before <RadSplitContainer Dock="DockedLeft"> is works fine. But our layoutfiles are generated by RadDocking.SaveLayout.
Telerik WPF Version 2012.2.725.40
Last_Layout.xml
I get an error when I try to load a layout which is saved from the last application-session. In the samples-code below I have redruced the code.
If I swap <RadSplitContainer InitialPosition="FloatingDockable"> before <RadSplitContainer Dock="DockedLeft"> is works fine. But our layoutfiles are generated by RadDocking.SaveLayout.
Location: System.RuntimeMethodHandle._InvokeMethodFast
Stack Trace:
bei System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
bei System.Delegate.DynamicInvokeImpl(Object[] args)
bei System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Inner Exception:
1. InnerException.Message:
System.InvalidOperationException: Element already has a logical parent. It must be detached from the old parent before it is attached to a new one.
bei MS.Internal.Controls.InnerItemCollectionView.AssertPristineModelChild(Object item)
bei MS.Internal.Controls.InnerItemCollectionView.Insert(Int32 index, Object item)
bei System.Windows.Controls.ItemCollection.Insert(Int32 insertIndex, Object insertItem)
bei Telerik.Windows.Controls.Docking.AutoHideArea.Add(RadPane pane, Boolean suppressAnimations)
bei Telerik.Windows.Controls.Docking.AutoHideArea.UnpinPane(RadPane pane, Boolean suppressAnimations)
bei Telerik.Windows.Controls.RadDocking.UnpinPane(RadPane radPane, AutoHideArea area, Boolean stopEvents)
bei Telerik.Windows.Controls.RadDocking.OnRadPanePinChange(Object sender, PinChangeEventArgs args)
Telerik WPF Version 2012.2.725.40
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"29"
/>
<
RowDefinition
Height
=
"1*"
/>
</
Grid.RowDefinitions
>
<
Button
Width
=
"94"
Content
=
"load Layout"
Click
=
"Button_Click"
/>
<
telerikDocking:RadDocking
x:Name
=
"radDocking"
Grid.Row
=
"1"
/>
</
Grid
>
private
void
Button_Click(
object
sender, RoutedEventArgs e)
{
try
{
using
(var fs =
new
FileStream(
"./Last_Layout.xml"
, FileMode.Open))
{
radDocking.LoadLayout(fs);
}
}
catch
(System.Exception ex)
{
System.Console.WriteLine(
"Error while loading lastlayout "
+ ex.Message);
}
}
Last_Layout.xml
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
RadDocking
>
<
DocumentHost
>
<
RadSplitContainer
>
<
Items
>
<
RadPaneGroup
SelectedIndex
=
"-1"
>
<
Items
/>
</
RadPaneGroup
>
</
Items
>
</
RadSplitContainer
>
</
DocumentHost
>
<
SplitContainers
>
<
RadSplitContainer
Dock
=
"DockedLeft"
Width
=
"240"
RelativeWidth
=
"100"
RelativeHeight
=
"100"
IsAutoGenerated
=
"True"
>
<
Items
>
<
RadPaneGroup
RelativeWidth
=
"100"
RelativeHeight
=
"100"
IsAutoGenerated
=
"True"
SelectedIndex
=
"0"
>
<
Items
>
<
RadPane
SerializationTag
=
"GKL.Module.PreisBildErhebung.ViewModule:BildExplorerView"
IsPinned
=
"False"
IsDockable
=
"False"
AutoHideWidth
=
"236"
AutoHideHeight
=
"994"
/>
</
Items
>
</
RadPaneGroup
>
</
Items
>
</
RadSplitContainer
>
<
RadSplitContainer
InitialPosition
=
"FloatingDockable"
FloatingWidth
=
"1722"
FloatingHeight
=
"1200"
FloatingX
=
"2024"
FloatingY
=
"0"
FloatingWindowState
=
"Normal"
IsInOpenWindow
=
"True"
RelativeWidth
=
"100"
RelativeHeight
=
"100"
IsAutoGenerated
=
"True"
>
<
Items
>
</
Items
>
</
RadSplitContainer
>
</
SplitContainers
>
</
RadDocking
>