Example #1
0
        /// <summary>
        /// Handler called when the user clicks the button to change the view type.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void switchViewButton_Click(object sender, EventArgs e)
        {
            if (bingMapsViewer != null)
            {
                BingMapsViewType previousType = bingMapsViewer.ViewType;

                switch (bingMapsViewer.ViewType)
                {
                case BingMapsViewType.Aerial:
                    bingMapsViewer.ViewType = BingMapsViewType.Road;
                    break;

                case BingMapsViewType.Road:
                    bingMapsViewer.ViewType = BingMapsViewType.Aerial;
                    break;

                default:
                    break;
                }

                switchViewButton.Text = String.Format("Switch to\n{0} view", previousType);
                bingMapsViewer.RefreshImages();
            }
        }