Ejemplo n.º 1
0
        /// <summary>
        /// Retrieve selected Contact
        /// </summary>
        /// <param name="contact"></param>
        private async void GetContact(Guid id)
        {
            Views.Shell.SetBusy(true, "Getting Contact...");

            // Try to re-use cached contact record when appropriate
            if (CurrentContact == null || id != CurrentContact.Id)
            {
                // Retrieve Contact if cache cannot be used
                CurrentContact = await crmservice.RetrieveContact(id);

                // As contact record has been changed, clear the activity
                CompletedActivities.Clear();
                CurrentActivity = null;
            }

            // If there is no completed activities for the contact, this runs all the time.
            if (CompletedActivities.Count == 0)
            {
                CompletedActivities = await crmservice.RetrieveActivitiesOfContact(id);
            }

            // Update Pin status
            Pin = _helper.ToggleAppBarButton();

            Views.Shell.SetBusy(false);

            CheckVoiceCommand();
        }