private static object ExitFrame(object frame) { ((DispatcherFrame)frame).Continue = false; return null; } }