Home Forums WPF controls Other WPF controls AvalonDock: NullReferenceException when deserializring layout (V3.0.0)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • petry@datotec.com
    Participant
    Post count: 3
    #44672 |

    I’m getting a NullReferenceException when calling Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize in Version 3.0.0.

    Here are the details of the exception:

    System.NullReferenceException occurred
    HResult=0x80004003
    Message=Object reference not set to an instance of an object.
    Source=Xceed.Wpf.AvalonDock
    StackTrace:
    at Xceed.Wpf.AvalonDock.Controls.LayoutItem.get_View()
    at Xceed.Wpf.AvalonDock.DockingManager.DetachAnchorablesSource(LayoutRoot layout, IEnumerable anchorablesSource)
    at Xceed.Wpf.AvalonDock.DockingManager.OnLayoutChanged(LayoutRoot oldLayout, LayoutRoot newLayout)
    at Xceed.Wpf.AvalonDock.DockingManager.OnLayoutChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
    at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
    at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
    at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
    at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
    at Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(TextReader reader)
    at Datotec.Wheels4.Windows.Unity.EntityViewDataContext.OnLoadView() in C:\Projects\Wheels\Wheels4UnityWpf\Views\EntityViewDataContext.cs:line 40
    at Datotec.Wheels4.Windows.Unity.EntityViewDataContext.DockingManager_Loaded(Object sender, RoutedEventArgs e) in C:\Projects\Wheels\Wheels4UnityWpf\Views\EntityViewDataContext.cs:line 30

    Here is the layout, i want to deserialize:

    <?xml version=”1.0″ encoding=”utf-16″?>
    <LayoutRoot xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>
    <RootPanel Orientation=”Vertical”>
    <LayoutPanel Orientation=”Horizontal”>
    <LayoutAnchorablePane Id=”0266a91c-15e5-41e5-93a9-49ad80357475″>
    <LayoutAnchorable CanHide=”False” AutoHideMinWidth=”100″ AutoHideMinHeight=”100″ Title=”Belege” IsSelected=”True” ContentId=”ValueGroup-afd181c3-15cd-4010-9e4c-669de0a4c633″ CanClose=”False” LastActivationTimeStamp=”03/20/2017 14:35:48″ />
    </LayoutAnchorablePane>
    <LayoutAnchorablePane FloatingWidth=”1267.33333333333″ FloatingHeight=”809.333333333333″ FloatingLeft=”1032.66666666667″ FloatingTop=”764.666666666667″>
    <LayoutAnchorable CanHide=”False” AutoHideMinWidth=”100″ AutoHideMinHeight=”100″ Title=”Beträge” IsSelected=”True” ContentId=”ValueGroup-7c6b40d6-0900-400d-8741-96220d94012c” FloatingLeft=”1032.66666666667″ FloatingTop=”764.666666666667″ FloatingWidth=”1267.33333333333″ FloatingHeight=”809.333333333333″ CanClose=”False” LastActivationTimeStamp=”03/20/2017 14:35:42″ PreviousContainerId=”0266a91c-15e5-41e5-93a9-49ad80357475″ PreviousContainerIndex=”1″ />
    </LayoutAnchorablePane>
    </LayoutPanel>
    <LayoutAnchorablePaneGroup Orientation=”Horizontal” FloatingWidth=”630.666666666667″ FloatingHeight=”809.333333333333″ FloatingLeft=”886.666666666667″ FloatingTop=”1149.33333333333″>
    <LayoutAnchorablePane FloatingWidth=”630.666666666667″ FloatingHeight=”809.333333333333″ FloatingLeft=”886.666666666667″ FloatingTop=”1149.33333333333″>
    <LayoutAnchorable CanHide=”False” AutoHideMinWidth=”100″ AutoHideMinHeight=”100″ Title=”Belegpositionen” IsSelected=”True” ContentId=”Relation-c1e6d297-82e0-420d-a236-c34ae77483f3″ FloatingLeft=”886.666666666667″ FloatingTop=”1149.33333333333″ FloatingWidth=”630.666666666667″ FloatingHeight=”809.333333333333″ CanClose=”False” LastActivationTimeStamp=”03/20/2017 14:35:52″ PreviousContainerId=”0266a91c-15e5-41e5-93a9-49ad80357475″ PreviousContainerIndex=”1″ />
    </LayoutAnchorablePane>
    </LayoutAnchorablePaneGroup>
    </RootPanel>
    <TopSide />
    <RightSide />
    <LeftSide />
    <BottomSide />
    <FloatingWindows />
    <Hidden />
    </LayoutRoot>

    In Version 2.9.0 the exception does not occur.

    What have changed at Xceed.Wpf.AvalonDock.Controls.LayoutItem.get_View() in version 3.0.0.
    What can I do to avoid this exception?

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    Is the issue reproducible in tha latest version of the toolkit V3.2? If yes, could you send me a simple stand alone sample project which reproduces the issue so that I could have a closer look. You man send it to: support@xceed.com

    petry@datotec.com
    Participant
    Post count: 3

    I’m using the community edition and V 3.2 is not available yet. Should I try to reproduce the error with a trial version or do you want a code sample with the v 3.0 community edition?

    petry@datotec.com
    Participant
    Post count: 3

    What can I do to help you solving this problem?

    Fawzi [Xceed]
    Member
    Post count: 722

    Hi,

    If the issue is fixed with the puls edition of the toolkit, the only way for you to get the fix would be through upgrading to the plus edition. Otherwise we cannot do anything to fix it in the current community edition of the toolkit.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.