コード例 #1
0
        public DetailPage(CustomPin pin)
        {
            this.BindingContext = new DetailViewModel(pin);

            var map = new LiteMap(default(MapSpan))
            {
                HeightRequest = 200
            };

            map.SetBinding <DetailViewModel> (LiteMap.ItemsSourceProperty, b => b.Pins);
            map.SetBinding <DetailViewModel> (LiteMap.VisibleRegionProperty, b => b.Span);

            this.SetBinding <DetailViewModel> (Page.TitleProperty, b => b.Title);

            var detail = new Label();

            detail.SetBinding <DetailViewModel> (Label.TextProperty, b => b.Description);

            Content = new StackLayout {
                Children =
                {
                    map,
                    new ContentView {
                        Padding = new Thickness(15),
                        Content = detail
                    }
                }
            };
        }
コード例 #2
0
        public DetailPage(CustomPin pin)
        {
            this.BindingContext = new DetailViewModel(pin);

            var map = new LiteMap (default(MapSpan)) {
                HeightRequest = 200
            };

            map.SetBinding<DetailViewModel> (LiteMap.ItemsSourceProperty, b => b.Pins);
            map.SetBinding<DetailViewModel> (LiteMap.VisibleRegionProperty, b => b.Span);

            this.SetBinding<DetailViewModel> (Page.TitleProperty, b => b.Title);

            var detail = new Label ();
            detail.SetBinding<DetailViewModel> (Label.TextProperty, b => b.Description);

            Content = new StackLayout {
                Children = {
                    map,
                    new ContentView {
                        Padding = new Thickness (15),
                        Content = detail
                    }
                }
            };
        }
コード例 #3
0
            public DetailViewModel(CustomPin pin)
            {
                this.Pins = new List<CustomPin>() { pin };
                this.Span = MapSpan.FromCenterAndRadius(
                    pin.Location,
                    Distance.FromMeters(1000)
                );

                this.Title = pin.Name;
                this.Description = pin.Details;

                this.RaisePropertyChanged("Description");
                this.RaisePropertyChanged("Title");
                this.RaisePropertyChanged("Span");
                this.RaisePropertyChanged("Pins");
            }
コード例 #4
0
            public DetailViewModel(CustomPin pin)
            {
                this.Pins = new List <CustomPin>()
                {
                    pin
                };
                this.Span = MapSpan.FromCenterAndRadius(
                    pin.Location,
                    Distance.FromMeters(1000)
                    );

                this.Title       = pin.Name;
                this.Description = pin.Details;

                this.RaisePropertyChanged("Description");
                this.RaisePropertyChanged("Title");
                this.RaisePropertyChanged("Span");
                this.RaisePropertyChanged("Pins");
            }