public MapCreationPage()
 {
     InitializeComponent();
     context        = new PinItemsSourcePageViewModel();
     geoCoder       = new Geocoder();
     BindingContext = context;
     map.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(54.3520500, 18.6463700), Distance.FromMiles(5)));
 }
        public PolygonMarkerPage()
        {
            InitializeComponent();

            BindingContext = new PinItemsSourcePageViewModel();
            GetLocation();
            buttonBuild.IsEnabled = false;

            try
            {
                AgriFarm agriFarm = App.SelectedAgriFarm;
                Title  = "Fazenda " + agriFarm.name.value;
                points = agriFarm.landLocation.value.coordinates;
                if (points.Count > 0)
                {
                    foreach (IList <double> point in points)
                    {
                        positions.Add(new Position(point[0], point[1]));
                    }
                    CreatePolygon();
                    buttonRebuild.IsVisible = true;
                    buttonClear.IsVisible   = false;
                    buttonSave.IsVisible    = false;
                }
            }
            catch (NullReferenceException e)
            {
                Log.Warning("NullReferenceException", e.Message);
            }



            /*
             * // usar variável global App.SelectedFarm aqui
             * Farm farm = App.FarmDatabase.GetFarmAsync(App.SelectedFarm.ID).Result;
             * Title = "Fazenda " + farm.Name;
             * if (!string.IsNullOrEmpty(farm.LandLocationBlobbed))
             * {
             *  foreach (Position position in farm.LandLocation)
             *      positions.Add(position);
             *  CreatePolygon();
             *  buttonRebuild.IsVisible = true;
             *  buttonClear.IsVisible = false;
             *  buttonSave.IsVisible = false;
             * }
             */
        }
        public MarkerPage()
        {
            InitializeComponent();
            App.Positions.Clear();
            //BindingContext = this;
            //_locations = new ObservableCollection<Location>();

            BindingContext = new PinItemsSourcePageViewModel();
            //this.Title = App.SelectedFarm.Name;
            GetLocation();

            //AddLocationCommand = new Command(AddLocation);
            //NavigateCommand = new Command<Type>(async (Type pageType) =>
            //{
            //    Page page = (Page)Activator.CreateInstance(pageType);
            //    //page.BindingContext = positions;
            //    await Navigation.PushAsync(page);
            //});
        }
 public PasturePage()
 {
     InitializeComponent();
     BindingContext = new PinItemsSourcePageViewModel();
     GetLocation();
 }