private static void OnFrameNavigated(object sender, NavigationEventArgs e) { if (e.Content == m_frameContentWhenOpened) ClosePickerPage(); else if (null == m_dateTimePickerPage) m_dateTimePickerPage = e.Content as RhoDateTimeDlg; }
private static void ClosePickerPage() { if (null != m_frame) { m_frame.Navigated -= OnFrameNavigated; m_frame.NavigationStopped -= OnFrameNavigationStoppedOrFailed; m_frame.NavigationFailed -= OnFrameNavigationStoppedOrFailed; m_frame = null; m_frameContentWhenOpened = null; } if (null != m_dateTimePickerPage) { m_dateValue = m_dateTimePickerPage.m_dateValue; m_timeValue = m_dateTimePickerPage.m_timeValue; DateTime result = new DateTime(); switch(m_fmt) { case 0: result = m_dateValue;//TODO// + m_timeValue; break; case 1: result = m_dateValue; break; case 2: result = m_timeValue; break; default: break; } long sec = (result - new DateTime(1970, 1, 1)).Ticks / 10000000; if (m_callback != "") { m_callback = RHODESAPP().canonicalizeRhoUrl(m_callback); String body =""; if(m_dateTimePickerPage.m_cancel == false) body += "status=ok&result=" + sec.ToString(); else body += "status=cancel"; if (m_opaque != null) body += "&opaque=" + m_opaque; body += "&rho_callback=1"; RhoClassFactory.createNetRequest().pushData(m_callback, body, null); //m_frame.InvalidateArrange(); } m_dateTimePickerPage = null; } }