コード例 #1
0
        //Set up the page
        private void setupPage()
        {
            timerOn = true;

            customMap = new CustomMap
            {
                MapType       = MapType.Street,
                WidthRequest  = App.ScreenWidth,
                HeightRequest = App.ScreenHeight
            };

            // create map type buttons
            var street = new Button {
                Text = "Street", BackgroundColor = Color.Black, TextColor = Color.White
            };
            var hybrid = new Button {
                Text = "Hybrid", BackgroundColor = Color.Black, TextColor = Color.White
            };
            var satellite = new Button {
                Text = "Satellite", BackgroundColor = Color.Black, TextColor = Color.White
            };

            street.Clicked    += HandleClicked;
            hybrid.Clicked    += HandleClicked;
            satellite.Clicked += HandleClicked;

            //Put map type buttons in a grid
            var mapTypeGrid = new Grid
            {
                RowDefinitions =
                {
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                },
                ColumnDefinitions =
                {
                    new ColumnDefinition {
                        Width = new GridLength(3.333, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(3.333, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(3.333, GridUnitType.Star)
                    }
                },
                ColumnSpacing = -5,
                RowSpacing    = -5
            };

            mapTypeGrid.Children.Add(street, 0, 0);
            mapTypeGrid.Children.Add(hybrid, 1, 0);
            mapTypeGrid.Children.Add(satellite, 2, 0);

            // put the map grid together
            grdMapGrid.Children.Add(mapTypeGrid, 0, 0);
            Grid.SetColumnSpan(mapTypeGrid, 2);
            grdMapGrid.Children.Add(customMap, 0, 1);
            Grid.SetColumnSpan(customMap, 2);

            //Create the horizontal bar to seperate default user from additional members
            //RowDefinition rowSpace = new RowDefinition();
            //rowSpace.Height = 1;

            //Put the members grid together
            //grdMembersGrid.RowDefinitions.Add(rowSpace);
            grdMapGrid.Children.Add(customMap);

            showGroupMembersInGrid();
            AddPinOnLoad();
            InitTimer();
            CheckForGroupUpdates();
        }