miqm / wpftoolkit

All the controls missing in WPF. Over 1 million downloads. Now available for .NET Core 3.0!
Microsoft Public License
5 stars 0 forks source link

AvalonDock floating window initialization fails #1

Open AIT-Employee opened 4 years ago

AIT-Employee commented 4 years ago

The following XAML causes a runtime exception

        xmlns:ad="http://schemas.xceed.com/wpf/xaml/avalondock"

                <ad:LayoutRoot.FloatingWindows>
                    <ad:LayoutAnchorableFloatingWindow>
                        <ad:LayoutAnchorablePaneGroup>
                            <ad:LayoutAnchorablePane FloatingHeight="80" FloatingWidth="200" FloatingLeft="20"
                                                     FloatingTop="20">
                                <ad:LayoutAnchorable ContentId="NavigatorPanel" Title="Navigator" CanClose="False"
                                                     CanHide="False">
                                    ...
                                </ad:LayoutAnchorable>
                            </ad:LayoutAnchorablePane>
                        </ad:LayoutAnchorablePaneGroup>
                    </ad:LayoutAnchorableFloatingWindow>
                </ad:LayoutRoot.FloatingWindows>

Exception:


System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Xceed.Wpf.AvalonDock
  StackTrace:
   at Xceed.Wpf.AvalonDock.Controls.LayoutAnchorableFloatingWindowControl.OnInitialized(EventArgs e)
   at System.Windows.FrameworkElement.TryFireInitialized() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkElement.cs:line 5513
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/FrameworkElement.cs:line 2087
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs:line 1757
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs:line 1571
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs:line 842
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/DependencyObject.cs:line 431
   at System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot) in /_/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/PresentationSource.cs:line 451
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) in /_/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/HwndSource.cs:line 614
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value) in /_/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/InterOp/HwndSource.cs:line 567
   at System.Windows.Window.SetRootVisual() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 2781
   at System.Windows.Window.SetRootVisualAndUpdateSTC() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 2787
   at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight) in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 2761
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow) in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 2508
   at System.Windows.Window.CreateSourceWindowDuringShow() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 2366
   at System.Windows.Window.SafeCreateWindowDuringShow() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 5244
   at System.Windows.Window.ShowHelper(Object booleanBox) in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 5339
   at System.Windows.Window.Show() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Window.cs:line 184
   at Xceed.Wpf.AvalonDock.DockingManager.<>c__DisplayClass265_0.<CreateUIElementForModel>b__0()
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Threading/ExceptionWrapper.cs:line 82
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Threading/ExceptionWrapper.cs:line 36
   at System.Windows.Threading.DispatcherOperation.InvokeImpl() in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherOperation.cs:line 540
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherOperation.cs:line 487
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) in /_/src/Microsoft.DotNet.Wpf/src/shared/MS/Internal/CulturePreservingExecutionContext.cs:line 214
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 172
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /_/src/System.Private.CoreLib/shared/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 63
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 200
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 132
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/Microsoft.DotNet.Wpf/src/shared/MS/Internal/CulturePreservingExecutionContext.cs:line 172
   at System.Windows.Threading.DispatcherOperation.Invoke() in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherOperation.cs:line 412
   at System.Windows.Threading.Dispatcher.ProcessQueue() in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs:line 2089
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs:line 2298
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) in /_/src/Microsoft.DotNet.Wpf/src/shared/MS/Win32/HwndWrapper.cs:line 295
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) in /_/src/Microsoft.DotNet.Wpf/src/shared/MS/Win32/HwndSubclass.cs:line 429
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Threading/ExceptionWrapper.cs:line 103
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/Threading/ExceptionWrapper.cs:line 36
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs:line 1331
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Microsoft.DotNet.Wpf/src/shared/MS/Win32/HwndSubclass.cs:line 341
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs:line 2137
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs:line 331
   at System.Windows.Threading.Dispatcher.Run() in /_/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/Dispatcher.cs:line 299
   at System.Windows.Application.RunDispatcher(Object ignore) in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs:line 2403
   at System.Windows.Application.RunInternal(Window window) in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs:line 1694
   at System.Windows.Application.Run() in /_/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Application.cs:line 198
   at CI_Fix_UI.App.Main()

  This exception was originally thrown at this call stack:
    Xceed.Wpf.AvalonDock.Controls.LayoutAnchorableFloatingWindowControl.OnInitialized(System.EventArgs)
    System.Windows.FrameworkElement.TryFireInitialized() in FrameworkElement.cs
    System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs) in FrameworkElement.cs
    System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs) in DependencyObject.cs
    System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, ref System.Windows.EffectiveValueEntry, bool, bool, System.Windows.OperationType) in DependencyObject.cs
    System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty, object, System.Windows.PropertyMetadata, bool, bool, System.Windows.OperationType, bool) in DependencyObject.cs
    System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty, object) in DependencyObject.cs
    System.Windows.PresentationSource.RootChanged(System.Windows.Media.Visual, System.Windows.Media.Visual) in PresentationSource.cs
    System.Windows.Interop.HwndSource.RootVisualInternal.set(System.Windows.Media.Visual) in HwndSource.cs
    System.Windows.Interop.HwndSource.RootVisual.set(System.Windows.Media.Visual) in HwndSource.cs
    ...
    [Call Stack Truncated]
miqm commented 4 years ago

@AIT-Employee which version are you using?

AIT-Employee commented 4 years ago

Hello,

Thank you for answering so quickly!

The error occurred in the version available via NuGet yesterday (sorry I did’nt remember exactly, but it started with 3.5). Today it is the version 3.5.1.3. Now I use the .Net Framework version instead (V3.8.1) and there it works (but I get warnings from Visual Studio). The same XAML code worked also years ago in another application.

Sorry, I didn’t have time to localize precisely at which statement the exception occurred. I hope the information given in the issue is sufficient.

Thank you again, Thomas

-- THOMAS RÜMMELE Research Engineer High-Performance Image Processing Center for Vision, Automation & Control

AIT Austrian Institute of Technology GmbH Giefinggasse 4, 1210 Vienna | Austria T +43 50550-3112 | M +43 664 8251069 | F +43 50550-2813 thomas.ruemmele@ait.ac.atmailto:thomas.ruemmele@ait.ac.at | http://www.ait.ac.athttp://www.ait.ac.at/ FN: 115980 i HG Wien | UID: ATU14703506 http://www.ait.ac.at/Email-Disclaimer Bitte beachten Sie unsere neue Geschäfts- und Rechnungsadresse Giefinggasse 4, 1210 Wien. Please note our new business and billing address Giefinggasse 4, 1210 Vienna.

Meet us: CONTROL 2020http://www.control-messe.de/, booth #6401, 5-8 May 2020, Stuttgart (DE) VISION 2020http://www.messe-stuttgart.de/vision/, booth #1D82,10-12 November 2020, Stuttgart (DE)

Von: Mikolaj M notifications@github.com Gesendet: Dienstag, 3. März 2020 23:26 An: miqm/wpftoolkit wpftoolkit@noreply.github.com Cc: Rümmele Thomas Thomas.Ruemmele@ait.ac.at; Mention mention@noreply.github.com Betreff: Re: [miqm/wpftoolkit] AvalonDock floating window initialization fails (#1)

@AIT-Employeehttps://github.com/AIT-Employee which version are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/miqm/wpftoolkit/issues/1?email_source=notifications&email_token=AOXBNYZQRMK27U73TPKDXJ3RFV7X7A5CNFSM4LAJSSB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENVND4Q#issuecomment-594203122, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AOXBNY6XEMPK72B66TG2UZLRFV7X7ANCNFSM4LAJSSBQ.