Пример #1
0
        private async void OnCheckForUpdates(object sender, RoutedEventArgs e)
        {
            bool updatesAvailable = await deviceManagementClient.CheckForUpdatesAsync();

            if (updatesAvailable)
            {
                System.Diagnostics.Debug.WriteLine("updates available");
                var dlg = new UserDialog("Updates available. Install?");
                await dlg.ShowAsync();

                // Don't do anything yet
            }
        }
Пример #2
0
        // This method may get called on the DM callback thread - not on the UI thread.
        public async Task <bool> YesNo(string question)
        {
            var tcs = new TaskCompletionSource <bool>();

            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
            {
                UserDialog dlg = new UserDialog(question);
                ContentDialogResult dialogResult = await dlg.ShowAsync();
                tcs.SetResult(dlg.Result);
            });

            var result = await tcs.Task;

            return(result);
        }