npolyak / NP.Ava.UniDock

New (Avalonia 11) UniDock repository
MIT License
141 stars 10 forks source link

Exception in DockContentPresenter #15

Closed adam-adorjan closed 7 months ago

adam-adorjan commented 7 months ago

Thanks for the upgrade to Avalonia 11!! We are currently integrating it into our product and noticed an exception:

System.NullReferenceException: Object reference not set to an instance of an object. at NP.Utilities.ReflectionUtils.SetFieldValue(Object obj, String fieldName, Object val, Boolean includeNonPublic, Type realType) at NP.Ava.UniDock.DockContentPresenter.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)

We tracked it down to the following code: case nameof(UseLayoutRounding): case nameof(BorderThickness): this.SetFieldValue("_layoutThickness", null!, true);

The logic isn't finding _layoutThickness because the .NET reflection logic doesn't look in base classes for some reason. Can you please take a look? Thanks!

npolyak commented 7 months ago

Thanks Adam, I'll look into it on Sunday, Feb 11.

npolyak commented 7 months ago

Thanks for reporting this issue. I fixed it. Please, update your unidock reference to NP.Ava.UniDock.1.0.6

npolyak commented 7 months ago

Please, also test it and close the issue.

adam-adorjan commented 7 months ago

Looks good! Thx!