示例#1
0
        private async void OnZoomClick(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            // Initiate task to zoom both map views in.
            Task t1 = MyMapViewTop.SetViewpointAsync(_zoomInPoint, TimeSpan.FromSeconds(5));
            Task t2 = MyMapViewBottom.SetViewpointAsync(_zoomInPoint, TimeSpan.FromSeconds(5));
            await Task.WhenAll(t1, t2);

            // Delay start of next set of zoom tasks.
            await Task.Delay(2000);

            // Initiate task to zoom both map views out.
            Task t3 = MyMapViewTop.SetViewpointAsync(_zoomOutPoint, TimeSpan.FromSeconds(5));
            Task t4 = MyMapViewBottom.SetViewpointAsync(_zoomOutPoint, TimeSpan.FromSeconds(5));
            await Task.WhenAll(t3, t4);
        }
示例#2
0
        private async void OnZoomClick(object sender, EventArgs e)
        {
            try
            {
                // Initiate task to zoom both map views in.
                Task t1 = MyMapViewTop.SetViewpointAsync(_zoomInPoint, TimeSpan.FromSeconds(5));
                Task t2 = MyMapViewBottom.SetViewpointAsync(_zoomInPoint, TimeSpan.FromSeconds(5));
                await Task.WhenAll(t1, t2);

                // Delay start of next set of zoom tasks.
                await Task.Delay(2000);

                // Initiate task to zoom both map views out.
                Task t3 = MyMapViewTop.SetViewpointAsync(_zoomOutPoint, TimeSpan.FromSeconds(5));
                Task t4 = MyMapViewBottom.SetViewpointAsync(_zoomOutPoint, TimeSpan.FromSeconds(5));
                await Task.WhenAll(t3, t4);
            }
            catch (Exception ex)
            {
                await((Page)Parent).DisplayAlert("Error", ex.ToString(), "OK");
            }
        }