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