When restoring multiscreen docking: System.ArgumentException: An item with the same key has already been added.

Guest on Nabble: PYB@Camag

Hi,

I use a two screens docking layout with v1 for several years without issues. But every time I set a similar layout in v2, it will crash on the next start (and all consecutive).

at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at DevExpress.Xpf.Docking.DockLayoutManager.ContainerGenerator.GetContainerForItem(IGeneratorHost generatorHost, Object item, DataTemplate itemTemplate, DataTemplateSelector itemTemplateSelector) at DevExpress.Xpf.Docking.DockLayoutManager.GetContainerForItem(Object item, BaseLayoutItem target) at Prosa.Log4View.Utils.Wpf.DockLayoutManagerEx.OnAddToItemsSource(IEnumerable newItems, Int32 startingIndex) at DevExpress.Xpf.Docking.BaseItemsCollection1.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
at System.Windows.WeakEventManager.ListenerList.DeliverEvent(Listener& listener, Object sender, EventArgs args, Type managerType)
at System.Windows.WeakEventManager.ListenerList1.DeliverEvent(Object sender, EventArgs e, Type managerType) at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args) at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
at Prosa.Log4View.Infrastructure.WorkspaceManager.Initialize()
at Prosa.Log4View.Core.Log4ViewVm.Start(Boolean loadSettings)
at Prosa.Log4View.Core.Log4ViewControl.OnLoaded(Object sender, 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.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Interop.HwndTarget.OnResize()
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

Hi

We are currently investigating this error and it will be fixed in the next release.
Sorry for the inconvenience.

Ulrich

Hi,

Just to be clear, I have the issue after I recreated the below v1 layout with v2.

Both windows are in fullscreen.

Best regards,

Pierre-Yann Bridé

Dear Pierre-Yann,

we just released a new beta version with a fix included.
You can find the latest beta version here:
http://www.log4view.com/download/beta-releases/

Yours sincerely

Philipp Lauchner
PROSA GmbH
Development & Support

Hi,

Thanks, it is working now.

Best regards,

Pierre-Yann