I am getting an exception when docking a window into my document host. Using Prism and MVVM according to your blog post on the subject I have the following simple XAML in m shell.
Two RadPane tabs are added to the RadPaneGroup. Initially both are set as "Tabbed Document". I run the application, bring up the context-menu for either pane and change it to "Dockable". The pane appears in a separate window as expected. When I click on the window and start dragging it the compass appears as expected. Now, as soon as I drag the window over one of the compass points the yellow preview rectangle appears as expected to indicate where the window will be positioned when docked. Then I immediately get the following exception.
<
telerik:RadDocking
Margin
=
"0,0"
Grid.Row
=
"2"
x:Name
=
"MainDock"
>
<
telerik:RadDocking.DocumentHost
>
<
telerik:RadPaneGroup cal:RegionManager.RegionName="MainRegion"
/>
</
telerik:RadDocking.DocumentHost
>
</
telerik:RadDocking
>
Two RadPane tabs are added to the RadPaneGroup. Initially both are set as "Tabbed Document". I run the application, bring up the context-menu for either pane and change it to "Dockable". The pane appears in a separate window as expected. When I click on the window and start dragging it the compass appears as expected. Now, as soon as I drag the window over one of the compass points the yellow preview rectangle appears as expected to indicate where the window will be positioned when docked. Then I immediately get the following exception.
System.Transactions Critical: 0 : <TraceRecord xmlns=
"http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord"
Severity=
"Critical"
><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled<;/TraceIdentifier><Description>Unhandled exception</Description><AppDomain>AZSi.SIB.WINAdmin2.vshost.exe</AppDomain><Exception><ExceptionType>System.ArgumentNullException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Value cannot be
null
.
Parameter name: element</Message><StackTrace> at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
at System.Windows.Media.Visual.IsAncestorOf(DependencyObject descendant)
at Telerik.Windows.Controls.RadDocking.<>c__DisplayClass8.<GetPaneGroup>b__7(RadPaneGroup group)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1342
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Telerik.Windows.Controls.RadDocking.GetPaneGroup(Point position, UIElement subtree, UIElement parent)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1339
at Telerik.Windows.Controls.RadDocking.MoveDraggedElement(Point position, ToolWindow draggedWindow)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1725
at Telerik.Windows.Controls.RadDocking.OnDragDelta(Point globalPosition, Object draggedElement)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 837
at Telerik.Windows.Controls.RadDocking.OnDragDelta(Object sender, DragInfoEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1284
at Telerik.Windows.Controls.Docking.DragInfoEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\DragDrop\DragInfoEventArgs.cs:line 48
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.Docking.FakePopup.<.ctor>b__0(Object s, RoutedEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\Popup\FakePopup.cs:line 26
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, UIElement dragRoot, MouseEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\DragDrop\DragDropHelper.cs:line 55
at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, MouseEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\DragDrop\DragDropHelper.cs:line 50
at Telerik.Windows.Controls.Docking.ToolWindow.OnToolWindowMouseMove(Object sender, MouseEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\ToolWindow.cs:line 721
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at AZSi.SIB.WINAdmin2.App.Main()
in
C:\Source\AZSi\Trunk\Source\AZSi.SIB.WINAdmin2\obj\x86\Release\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>System.ArgumentNullException: Value cannot be
null
.
Parameter name: element
at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
at System.Windows.Media.Visual.IsAncestorOf(DependencyObject descendant)
at Telerik.Windows.Controls.RadDocking.<>c__DisplayClass8.<GetPaneGroup>b__7(RadPaneGroup group)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1342
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
at Telerik.Windows.Controls.RadDocking.GetPaneGroup(Point position, UIElement subtree, UIElement parent)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1339
at Telerik.Windows.Controls.RadDocking.MoveDraggedElement(Point position, ToolWindow draggedWindow)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1725
at Telerik.Windows.Controls.RadDocking.OnDragDelta(Point globalPosition, Object draggedElement)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 837
at Telerik.Windows.Controls.RadDocking.OnDragDelta(Object sender, DragInfoEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\RadDocking.cs:line 1284
at Telerik.Windows.Controls.Docking.DragInfoEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\DragDrop\DragInfoEventArgs.cs:line 48
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.Docking.FakePopup.<.ctor>b__0(Object s, RoutedEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\Popup\FakePopup.cs:line 26
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, UIElement dragRoot, MouseEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\DragDrop\DragDropHelper.cs:line 55
at Telerik.Windows.Controls.Docking.DragDropHelper.DragDelta(UIElement target, MouseEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\DragDrop\DragDropHelper.cs:line 50
at Telerik.Windows.Controls.Docking.ToolWindow.OnToolWindowMouseMove(Object sender, MouseEventArgs e)
in
c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP2\Sources\Development\Controls\Docking\Docking\ToolWindow.cs:line 721
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at AZSi.SIB.WINAdmin2.App.Main()
in
C:\Source\AZSi\Trunk\Source\AZSi.SIB.WINAdmin2\obj\x86\Release\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</ExceptionString><DataItems><Data></Data></DataItems></Exception></TraceRecord>
An unhandled exception of type
'System.ArgumentNullException'
occurred
in
WindowsBase.dll
Additional information: Value cannot be
null
.