Exemplo n.º 1
0
        public override async Task LoadAsync()
        {
            MessengerInstance.Send(new BusyMessage(true, this));
            await base.LoadAsync();

            if (_preLoaded != null)
            {
                SelectedItem = Index.Where(r => r.Id == _preLoaded.Id).FirstOrDefault();
            }
            else
            {
                SelectedItem = Index.FirstOrDefault();
            }
            try
            {
                await LoadLookupAsync();
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("Unexpexted exception loading! {0}", ex);
                FeedbackActions.ReactToException(ex);
            }
            finally
            {
                MessengerInstance.Send(new BusyMessage(false, this));
            }
        }
Exemplo n.º 2
0
 public static void ProvideFeedback(string text)
 {
     if (feedbackAction == null)
     {
         // synchronize to avoid duplicate calls
         lock (syncLock)
         {
             if (feedbackAction == null)
             {
                 var value = ConfigurationManager.AppSettings["FeedbackAction"];
                 feedbackAction = FeedbackActions.GetAction(value);
             }
         }
     }
     feedbackAction(text);
 }
Exemplo n.º 3
0
        public override async Task LoadAsync()
        {
            MessengerInstance.Send(new BusyMessage(true, this));
            await base.LoadAsync();

            try
            {
                await LoadLookupAsync();
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("Unexpexted exception loading! {0}", ex);
                FeedbackActions.ReactToException(ex);
            }
            finally
            {
                MessengerInstance.Send(new BusyMessage(false, this));
            }
        }
Exemplo n.º 4
0
        public async virtual Task LoadAsync()
        {
            MessengerInstance.Send(new BusyMessage(true, this));
            try
            {
                await LoadIndexAsync();

                CanSelectItem = true;
            }
            catch (Exception ex)
            {
                Log.ErrorFormat("Unexpexted exception loading! {0}", ex);
                FeedbackActions.ReactToException(ex);
            }
            finally
            {
                MessengerInstance.Send(new BusyMessage(false, this));
            }
        }