这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@mennowo
Copy link

@mennowo mennowo commented Jun 25, 2019

My application is unable to deserialize AvalonDock xml data cause of a null reference: Root.Manager is null during deserializing. This fixes that issue, and deserialization works fine again.

@Dirkster99
Copy link
Owner

Hi,

your suggested fix looks technically OK - but its normally not possible that the Root.Manager property is null during the load of the XML Layout. Its therfore, likely that you have a timing/synchronization problem and the root cause is somewhere else :-(

I seriously wonder if you have the same issue as reported by @Muhahe in issue #38.

The analysis already states that the DispatcherPriority.Background priority is needed to deserialize succesfully. The issue reported is the same as your issue but based on a different workflow.

Can you please check and maybe work with @Muhahe to come up with a better fix? One, way I could think of is to load the XML from file system in a background thread and give it to AvalonDock (as string) with the DispatcherPriority.Background. Thats not a simple fix but should work as it does in other test apps - but it should be much smoother since the UI does not have to wait t´for the filesystem...

Querstion: Would a solution like this work for you and maybe even @Muhahe?

@mennowo
Copy link
Author

mennowo commented Jun 25, 2019

Hi @Dirkster99 , thanks for your prompt response. I will look into this and consider your proposal (it would certainly be OK as far as I am concerned) but it will a while, cause I will be away for a couple of weeks. I have to confess I did not do a lot of looking, but rather noticed the exception, added a null check and found it was fixed. I'll try to find time to create a better fix as you suggested.

@Dirkster99
Copy link
Owner

Version 3.5.10 and later will include the suggested solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants