public void OnClick(Views.View v) { if (CoreSettings.NavStyle == NavType.MasterDetail && CoreSettings.AppNav.NavigationStack.Count <= 1) { InjectionManager.SendViewModelMessage(CoreSettings.MasterDetailIsPresented, null); return; } // Call the NavigationPage which will trigger the default behavior // The default behavior is to navigate back if the Page derived classes return true from OnBackButtonPressed override var curPage = Element.CurrentPage as BasePages; if (curPage == null) { Element.PopAsync(); } else { if (curPage.NeedOverrideSoftBackButton) { curPage.OnSoftBackButtonPressed(); } else { Element.PopAsync(); } } }
public void CallEndedEvent(CTCall call) { if (TelephoneManager.IsListening && call.CallState == "CTCallStateDisconnected") { TelephoneManager.IsListening = false; InjectionManager.SendViewModelMessage(TelephoneManager.CallBackKey, true); } }
private void PhoneCallEnded(DateTime start, DateTime end) { if (phoneListener != null) { phoneListener.CallEndedEvent -= PhoneCallEnded; } telephonyManager.Listen(phoneListener, PhoneStateListenerFlags.None); phoneListener = null; InjectionManager.SendViewModelMessage(callBackKey, true); }
/// <summary> /// Broadcast message to a particular view model instance /// </summary> /// <param name="key">Key.</param> /// <param name="obj">Object.</param> /// <typeparam name="T">The 1st type parameter.</typeparam> protected void SendViewMessage <T>(string key, object obj) where T : ObservableViewModel { InjectionManager.SendViewModelMessage <T>(key, obj); }
/// <summary> /// Broadcast message to all view model instances /// </summary> /// <param name="key">Key.</param> /// <param name="obj">Object.</param> protected void SendViewMessage(string key, object obj) { InjectionManager.SendViewModelMessage(key, obj); }