These are chat archives for punker76/MahApps.Metro.SimpleChildWindow

19th
Feb 2015
Darnell Williams
@Seeker1437
Feb 19 2015 17:24

Help D: I sloooow
An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll

Additional information: The provided child window can not add, the container can not be found.

Jan Karger
@punker76
Feb 19 2015 17:35
can you give me more information? a little code snippet where the call come frome. or stacktrace
Darnell Williams
@Seeker1437
Feb 19 2015 18:14
Yes sorry
2/19/2015 1:13:23 PM [Error] - Uknown Error
2/19/2015 1:13:23 PM [Exception] - System.InvalidOperationException: The provided child window can not add, the container can not be found.
   at MahApps.Metro.SimpleChildWindow.ChildWindowManager.ShowChildWindowAsync(MetroWindow window, ChildWindow dialog, OverlayFillBehavior overlayFillBehavior)
   at CallStatRecorder2.MainWindow.<ShowChildWindow>d__0.MoveNext() in c:\Users\Darnell\Documents\GitHub\CallStatRecorder-2\CallStatRecorder2\CallStatRecorder2\MainWindow.xaml.cs:line 27
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>b__4(Object state)
   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.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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.LegacyInvokeImpl(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 CallStatRecorder2.App.Main() in c:\Users\Darnell\Documents\GitHub\CallStatRecorder-2\CallStatRecorder2\CallStatRecorder2\obj\Release\App.g.cs:line 0
   at CallStatRecorder2.Program.Main() in c:\Users\Darnell\Documents\GitHub\CallStatRecorder-2\CallStatRecorder2\CallStatRecorder2\Program.cs:line 32
oh right forgot the other info
Darnell Williams
@Seeker1437
Feb 19 2015 18:31
Oh its a control not a window.
Been doing it wrong I guess.
Darnell Williams
@Seeker1437
Feb 19 2015 20:09
I figured it out
I was calling the child window in the constructor.
Is there a safe way to do with?
Jan Karger
@punker76
Feb 19 2015 20:10
?
Darnell Williams
@Seeker1437
Feb 19 2015 20:11
Had to move ShowChildWindow outside of the constructor
Jan Karger
@punker76
Feb 19 2015 20:12
oh, i see, yes that's the better way, cause the MetroWindow template isn't loaded, so there is no container
is this a problem for you?
Darnell Williams
@Seeker1437
Feb 19 2015 20:29
Kinda, I was hoping I could use the childwindow during the process for the LegacyRecordKeeper during the initialization process
The component's themselves reference the information created by the LRK (which happens to be finished before the window loads)
Darnell Williams
@Seeker1437
Feb 19 2015 20:40
I will work around it anyways for now :D
Okay a couple questions because I think I broke something XD
Remember the loading indicatorsproject? Whenever I try to use them they never render. It's like it's missing it's InitializeComponent, but then it also does not have one.
Darnell Williams
@Seeker1437
Feb 19 2015 21:11
Okay on topic, how would I correct the model effect? It kind stays the design size
Jan Karger
@punker76
Feb 19 2015 21:11
what do you mean with model effect?
Darnell Williams
@Seeker1437
Feb 19 2015 21:12
the overlay sorry
Jan Karger
@punker76
Feb 19 2015 21:14
is there any content?
Darnell Williams
@Seeker1437
Feb 19 2015 21:16
Currently a textblock but it's collapsed
Jan Karger
@punker76
Feb 19 2015 21:17
the window uses autosize by default
you can set ChildWindowWidth or ChildWindowHeight if you need this
Darnell Williams
@Seeker1437
Feb 19 2015 21:22
AH wow I wish I noticed that earlier