private async void MyMapView_SpatialReferenceChanged(object sender, EventArgs e)
		{
			try
			{
				_printTask = new PrintTask(new Uri(PrintTaskUrl));
				var info = await _printTask.GetTaskInfoAsync();

				comboLayout.ItemsSource = info.LayoutTemplates;
				if (info.LayoutTemplates != null && info.LayoutTemplates.Count > 0)
					comboLayout.SelectedIndex = 0;

				comboFormat.ItemsSource = info.Formats;
				if (info.Formats != null && info.Formats.Count > 0)
					comboFormat.SelectedIndex = 0;
			}
			catch (Exception ex)
			{
				var _x = new MessageDialog(ex.Message, "Sample Error").ShowAsync();
			}
		}
        private async void MyMapView_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                var info = await _printTask.GetTaskInfoAsync();

                comboLayout.ItemsSource = info.LayoutTemplates;
                if (info.LayoutTemplates != null && info.LayoutTemplates.Count > 0)
                {
                    comboLayout.SelectedIndex = 0;
                }

                comboFormat.ItemsSource = info.Formats;
                if (info.Formats != null && info.Formats.Count > 0)
                {
                    comboFormat.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sample Error");
            }
        }
示例#3
0
        private async void MyMapView_SpatialReferenceChanged(object sender, EventArgs e)
        {
            try
            {
                _printTask = new PrintTask(new Uri(PrintTaskUrl));
                var info = await _printTask.GetTaskInfoAsync();

                comboLayout.ItemsSource = info.LayoutTemplates;
                if (info.LayoutTemplates != null && info.LayoutTemplates.Count > 0)
                {
                    comboLayout.SelectedIndex = 0;
                }

                comboFormat.ItemsSource = info.Formats;
                if (info.Formats != null && info.Formats.Count > 0)
                {
                    comboFormat.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {
                var _x = new MessageDialog(ex.Message, "Sample Error").ShowAsync();
            }
        }