Monitorian
Monitorian copied to clipboard
The root Visual of a VisualTarget cannot have a parent.
I have found a record of exception when tried to show main window by clicking the notification icon. It seems that something wrong happened when Window.Show method was called. I have no idea what caused this exception but post it just for record.
System.ArgumentException: The root Visual of a VisualTarget cannot have a parent. HResult: -2147024809 ParamName: NULL
at System.Windows.Media.CompositionTarget.SetRootVisual(Visual visual)
at System.Windows.Media.CompositionTarget.set_RootVisual(Visual value)
at System.Windows.Interop.HwndTarget.set_RootVisual(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Window.SetRootVisual()
at System.Windows.Window.SetRootVisualAndUpdateSTC()
at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.CreateSourceWindowDuringShow()
at System.Windows.Window.SafeCreateWindowDuringShow()
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.Show()
at Monitorian.Core.Views.MainWindow.ShowForeground()
at Monitorian.Core.AppControllerCore.ShowMainWindow()
at Monitorian.Core.AppControllerCore.<OnMainWindowShowRequestedBySelf>d__22.MoveNext()
As a workaround, I modified to catch this ArgumentException by 861d43dc34ad47f1243f3770086d857fe83aeeec I will wait and see for a while.
I have not encountered this exception for long period and so decided to close this issue.