public new void OnClick(Views.View v)
        {
            if (IsMasterDetail() && CoreSettings.AppNav.NavigationStack.Count <= 1)
            {
                CoreDependencyService.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();
                }
            }
        }
Exemple #2
0
 public void CallEndedEvent(CTCall call)
 {
     if (TelephoneManager.IsListening && call.CallState == "CTCallStateDisconnected")
     {
         TelephoneManager.IsListening = false;
         CoreDependencyService.SendViewModelMessage(TelephoneManager.CallBackKey, true);
     }
 }
        public LocalizationService()
        {
            var culture  = CoreDependencyService.GetDependency <ILocalize>().GetCurrentCultureInfo();
            var fileName = $"{culture.TwoLetterISOLanguageName.ToLower()}.json";

            var storage = (IFileStore)CoreDependencyService.GetService <IFileStore, FileStore>(true);

            storage.GetAsync <Dictionary <string, string> >(fileName).ContinueWith((data) =>
            {
                if (data.Result.Success)
                {
                    IsLoaded    = true;
                    localString = data.Result.Response;
                    CoreDependencyService.SendViewModelMessage(CoreSettings.LocalizationLoaded, null);
                }
            });
        }
Exemple #4
0
 /// <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 : CoreViewModel
 {
     CoreDependencyService.SendViewModelMessage <T>(key, obj);
 }
Exemple #5
0
 /// <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)
 {
     CoreDependencyService.SendViewModelMessage(key, obj);
 }