public SettingPopupPage()
        {
            InitializeComponent();
            Animation = new UserAnimation();

            finishPage       = new FinishedPopupPage();
            selectLevelPopup = new SelectLevelPopupPage();
            selectLevelPopup.SetSettingDelegate(this);

            selectGatePopup = new SelectGatePopupPage();
            selectGatePopup.SetSettingDelegate(this);

            selectImagePopup = new SelectImagePopupPage();
            selectImagePopup.SetSettingDelegate(this);
            var tapImage = new TapGestureRecognizer();

            tapImage.Tapped += SettingLevel_Handler;
            imgSettingLevel.GestureRecognizers.Add(tapImage);

            var tapImageSettingGate = new TapGestureRecognizer();

            tapImageSettingGate.Tapped += SettingGate_Handler;
            imgSettingGate.GestureRecognizers.Add(tapImageSettingGate);

            var tapImageSettingImage = new TapGestureRecognizer();

            tapImageSettingImage.Tapped += SettingImage_Handler;
            imgSettingImage.GestureRecognizers.Add(tapImageSettingImage);

            var tapImageSaveImage = new TapGestureRecognizer();

            tapImageSaveImage.Tapped += Save_Handler;
            imgSave.GestureRecognizers.Add(tapImageSaveImage);
        }
Exemple #2
0
        public Map()
        {
            currentLevel    = 2;
            currentMapIndex = 0;
            finishPage      = new FinishedPopupPage(5);
            finishPage.SetMapDelegate(this);
            dicLevelToAllowTipStep.Add(2, 1);
            dicLevelToAllowTipStep.Add(3, 1);
            dicLevelToAllowTipStep.Add(4, 1);
            dicLevelToAllowTipStep.Add(5, 2);
            dicLevelToAllowTipStep.Add(6, 2);

            Title           = "Pokemon Switch";
            BackgroundColor = Color.FromHex("#404040");
            #region Button Style
            plainButton = new Style(typeof(ImageButton))
            {
                Setters =
                {
                    new Setter {
                        Property = Button.BackgroundColorProperty, Value = Color.FromHex("#eee")
                    },
                    new Setter {
                        Property = Button.TextColorProperty, Value = Color.Black
                    },
                    new Setter {
                        Property = Button.BorderRadiusProperty, Value = 5
                    },
                    new Setter {
                        Property = Button.FontSizeProperty, Value = 40
                    },
                    new Setter {
                        Property = ImageButton.OrientationProperty, Value = ImageOrientation.ImageCentered
                    }
                }
            };
            var darkerButton = new Style(typeof(Button))
            {
                Setters =
                {
                    new Setter {
                        Property = Button.BackgroundColorProperty, Value = Color.FromHex("#ddd")
                    },
                    new Setter {
                        Property = Button.TextColorProperty, Value = Color.Black
                    },
                    new Setter {
                        Property = Button.BorderRadiusProperty, Value = 0
                    },
                    new Setter {
                        Property = Button.FontSizeProperty, Value = 40
                    }
                }
            };
            orangeButton = new Style(typeof(Button))
            {
                Setters =
                {
                    new Setter {
                        Property = Button.BackgroundColorProperty, Value = Color.FromHex("#E8AD00")
                    },
                    new Setter {
                        Property = Button.TextColorProperty, Value = Color.White
                    },
                    new Setter {
                        Property = Button.BorderRadiusProperty, Value = 0
                    },
                    new Setter {
                        Property = Button.FontSizeProperty, Value = 40
                    },
                    new Setter {
                        Property = ImageButton.OrientationProperty, Value = ImageOrientation.ImageCentered
                    }
                }
            };
            #endregion

            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            mainGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            Header header = new Header(this);
            mainGrid.Children.Add(header, 0, 0);
            Grid.SetRowSpan(header, 2);
            header.BindingContext = _headerVM;

            controlGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            controlGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            controlGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });
            controlGrid.RowDefinitions.Add(new RowDefinition {
                Height = new GridLength(1, GridUnitType.Star)
            });

            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });
            controlGrid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1, GridUnitType.Star)
            });

            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 0, 0);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 0, 1);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 0, 2);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 0, 3);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 1, 0);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 1, 1);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 1, 2);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 1, 3);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 2, 0);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 2, 1);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 2, 2);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 2, 3);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 3, 0);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 3, 1);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 3, 2);
            controlGrid.Children.Add(new ImageButton {
                Style = plainButton
            }, 3, 3);

            mainGrid.Children.Add(controlGrid, 0, 2);
            Grid.SetRowSpan(controlGrid, 4);

            //MapFooter footer = new MapFooter(this);
            //mainGrid.Children.Add(footer, 0, 6);
            //Grid.SetColumnSpan(footer, 1);

            mainGrid.BackgroundColor = Color.FromHex("#558B2F");
            Content = mainGrid;
        }