Code52 / DownmarkerWPF

MarkPad - a visual Markdown editor (inspired by the Downmarker project)
http://code52.org/DownmarkerWPF/
Microsoft Public License
1.4k stars 459 forks source link

This Visual is not connected to a PresentationSource. #461

Open boltomli opened 8 years ago

boltomli commented 8 years ago

I was going to close MarkPad on Surface Pro 4 and hit this. Latest release build from ClickOnce install.

Date and Time: 2016/1/17 23:14:32 OS Version: Microsoft Windows NT 6.2.9200.0

Application Domain: DefaultDomain Assembly Codebase: file:///C:/Users/d/AppData/Local/Apps/2.0/X5HGOY35.XNC/COZ8XMDY.28R/mark...app_0000000000000000_0000.000a_4fe90f97b0816791/MarkPad.exe Assembly Full Name: MarkPad, Version=0.10.0.12, Culture=neutral, PublicKeyToken=null Assembly Version: 0.10.0.12 Assembly Build Date: 2016/1/17 15:05:36

Exception Source: PresentationCore Exception Type: System.InvalidOperationException Exception Message: This Visual is not connected to a PresentationSource. Exception Target Site: PointFromScreen

---- Stack Trace ---- System.Windows.Media.Visual.PointFromScreen(Point point) MarkPad.exe: N 7570221 MahApps.Metro.Behaviours.BorderlessWindowBehavior.HwndHook(IntPtr hWnd, Int32 message, IntPtr wParam, IntPtr lParam, Boolean& handled) MarkPad.exe: N 00934 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) MarkPad.exe: N 00111 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) MarkPad.exe: N 00154 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) MarkPad.exe: N 00106 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) MarkPad.exe: N 00081 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) MarkPad.exe: N 00051

boltomli commented 8 years ago

Guess it's related to a extremely big screenshot I paste and save in the md... shot

shiftkey commented 8 years ago

This might be fixed in MahApps.Metro but when I last looked at this the interface has changed and ResizeWithGrip has been obsoleted - might be a minor thing, but needs investigating...

e.g. https://github.com/Code52/DownmarkerWPF/blob/200df7b3d571dd5a7e4820246c5d4f2d3761021b/src/MarkPad/Document/Controls/HyperlinkEditorView.xaml#L14