Пример #1
0
        /// <summary>
        /// Maps the tapped.
        /// </summary>
        /// <param name="sender">The sender of the tapped event inside the map.</param>
        /// <param name="e">The arguments of the map tapped event.</param>
        private void MapTapped(object sender, MapTappedEventArgs e)
        {
            var tappedField = this.CheckFieldClicked(e.Position);

            if (tappedField != null)
            {
                this.SelectedField = tappedField;
            }

            if (e.Zoomlevel > 15)
            {
                var tappedBlock = this.CheckBlockClicked(e.Position);
                if (tappedBlock != null)
                {
                    this.selectedBlock = tappedBlock;
                    var navigationPage = (NavigationPage)Application.Current.MainPage;

                    var informationViewModel = new InformationViewModel(this.SelectedField, this.SelectedBlock);
                    navigationPage.PushAsync(new BlockInformationContentPage(informationViewModel));
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Maps the tapped.
        /// </summary>
        /// <param name="sender">The sender of the tapped event inside the map.</param>
        /// <param name="e">The arguments of the map tapped event.</param>
        private void MapTapped(object sender, MapTappedEventArgs e)
        {
            var tappedField = this.CheckFieldClicked(e.Position);
            if (tappedField != null)
            {
                this.SelectedField = tappedField;
            }

            if (e.Zoomlevel > 15)
            {
                var tappedBlock = this.CheckBlockClicked(e.Position);
                if (tappedBlock != null)
                {
                    this.selectedBlock = tappedBlock;
                    var navigationPage = (NavigationPage)Application.Current.MainPage;

                    var informationViewModel = new InformationViewModel(this.SelectedField, this.SelectedBlock);
                    navigationPage.PushAsync(new BlockInformationContentPage(informationViewModel));
                }
            }
        }