async protected override void OnAppControlReceived(Native.AppControlReceivedEventArgs e) { base.OnAppControlReceived(e); Native.AppControl appControl = e.ReceivedAppControl; try { if (appControl.ExtraData.Count() != 0) { IEnumerable <string> stack1 = appControl.ExtraData.GetKeys(); string type = appControl.ExtraData.Get <string>("RingType"); if (type == RingType.RING_TYPE_ALARM.ToString()) { var navi = app_.MainPage as NavigationPage; var currentPage = navi.CurrentPage; string AlarmCreatedDate = appControl.ExtraData.Get <string>("AlarmRecord.UniqueIdentifier"); if (AlarmModel.AlarmRecordDictionary == null) { // IAlarmPersistentHandler serizliazer = DependencyService.Get<IAlarmPersistentHandler>(); // Need to retrieve at the page creation time AlarmModel.AlarmRecordDictionary = DependencyService.Get <IAlarmPersistentHandler>().DeserializeAlarmRecord(); } AlarmRecord retrievedRecord; if (AlarmModel.AlarmRecordDictionary != null) { if (AlarmModel.AlarmRecordDictionary.TryGetValue(AlarmCreatedDate, out retrievedRecord)) { if (retrievedRecord == null) { DependencyService.Get <ILog>().Error("[OnAppControlReceived]", "retrievedRecord is null!!"); } if (retrievedRecord != null && retrievedRecord.AlarmState < AlarmStates.Inactive) { retrievedRecord.PrintProperty(); await currentPage.Navigation.PushAsync(new RingPage(RingType.RING_TYPE_ALARM, retrievedRecord)); } } } } else if (type == RingType.RING_TYPE_TIMER.ToString()) { var navi = app_.MainPage as NavigationPage; var currentPage = navi.CurrentPage as MainTabbedPage; await currentPage.Navigation.PushAsync(new RingPage(RingType.RING_TYPE_TIMER)); } } } catch (Exception ex) { Debug.WriteLine("[OnAppControlReceived] Exception - Message: " + ex.Message + ", source: " + ex.Source + ", " + ex.StackTrace); } }
/// <summary> /// Overrides this method if want to handle behavior when the application receives the appcontrol message. /// If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be emitted. /// </summary> /// <param name="e"></param> /// <since_tizen> 3 </since_tizen> protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e) { AppControlReceived?.Invoke(this, e); }
/// <summary> /// This method is to handle behavior when the task of the application receives the appcontrol message. /// </summary> /// <param name="e"></param> /// <since_tizen> 10 </since_tizen> public virtual void OnAppControlReceived(AppControlReceivedEventArgs e) { }