Пример #1
0
        async Task LoadContacts()
        {
            var watch = Stopwatch.StartNew();
            IContactServices contactServices = (Application.Current as App).contactServices;

            contactServices.OnContactLoaded += OnContactLoaded;

            try { await contactServices.ContactsAsync(); }
            catch (TaskCanceledException) { Console.WriteLine("Task was cancelled"); }

            contactServices.OnContactLoaded -= OnContactLoaded;
            watch.Stop();
            var elapsedMs = watch.Elapsed.TotalSeconds;

            Debug.WriteLine("Tiempo al leer los contactos: " + elapsedMs + " seg");
        }