TextBox decorate class
Наследование: UIBase
Пример #1
0
        private void AchievementsByCodePanel()
        {
            var unlockAchievementlabel = new TextBlock()
            {
                Text = "Enter achievement code:",
                Width = 200,
            };
            var unlockAchievementText = new TextBox()
            {
                Text = string.Empty,
                Height = 60,
                Width = _buttonWidth,
                Margin = new Thickness(_spaceControl, 0, 0, 0)
            };

            // Unlock achievement by code
            var unlockAchievementCodeButton = new Button()
            {
                Width = _buttonWidth,
                Height = _buttonHeight,
                Text = "Unlock achievement by code",
                Foreground = _foregroundButton,
                BackgroundColor = _backgroundColor,
                Margin = new Thickness(_spaceControl, 0, 0, 0)
            };
            unlockAchievementCodeButton.Click += async (s, e) =>
            {
                var code = unlockAchievementText.Text;
                await _socialService.UnlockAchievement(code);
            };

            var sp3 = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Margin = new Thickness(100, _topMargin + 5, 0, 0),
            };
            sp3.Add(unlockAchievementlabel);
            sp3.Add(unlockAchievementText);
            sp3.Add(unlockAchievementCodeButton);

            EntityManager.Add(sp3);
        }
Пример #2
0
        private void AddNewScorePanel()
        {
            var addNewScorelabel1 = new TextBlock()
            {
                Text = "Enter leaderboard code:",
                Width = 200,
            };
            var addNewScoreCodeText1 = new TextBox()
            {
                Text = string.Empty,
                Height = 60,
                Width = _buttonWidth,
                Margin = new Thickness(_spaceControl, 0, 0, 0)
            };

            var addNewScorelabel2 = new TextBlock()
            {
                Text = "Enter new score:",
                Width = 200,
            };
            var addNewScoreCodeText2 = new TextBox()
            {
                Text = string.Empty,
                Height = 60,
                Width = _buttonWidth,
                Margin = new Thickness(_spaceControl, 0, 0, 0)
            };

            var sp5 = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Margin = new Thickness(100, _topMargin + 5, 0, 0),
            };
            sp5.Add(addNewScorelabel1);
            sp5.Add(addNewScoreCodeText1);

            _topMargin += 70;

            var sp6 = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Margin = new Thickness(100, _topMargin + 5, 0, 0),
            };
            sp6.Add(addNewScorelabel2);
            sp6.Add(addNewScoreCodeText2);

            EntityManager.Add(sp5);
            EntityManager.Add(sp6);

            // Add new score
            var addNewScoreCodeButton = new Button()
            {
                Width = _buttonWidth,
                Height = _buttonHeight,
                Text = "Add new Score",
                Foreground = _foregroundButton,
                BackgroundColor = _backgroundColor,
                Margin = new Thickness(_topMargin + _spaceControl + 15, 580, 0, 0)
            };
            addNewScoreCodeButton.Click += (s, e) =>
            {
                var code = addNewScoreCodeText1.Text;
                var score = addNewScoreCodeText2.Text;

                if (string.IsNullOrEmpty(code) || string.IsNullOrEmpty(score))
                {
                    return;
                }

                var longScore = long.Parse(score);

                _socialService.AddNewScore(code, longScore);
            };

            EntityManager.Add(addNewScoreCodeButton);
        }
Пример #3
0
        private void CreateLeaderBoardByCodePanel()
        {
            var leaderboardlabel = new TextBlock()
            {
                Text = "Enter leaderboard code:",
                Width = 200,
            };
            var leaderboardCodeText = new TextBox()
            {
                Text = string.Empty,
                Height = 60,
                Width = _buttonWidth,
                Margin = new Thickness(_spaceControl, 0, 0, 0)
            };

            // Show leaderboard by code
            var leaderboardCodeButton = new Button()
            {
                Width = _buttonWidth,
                Height = _buttonHeight,
                Text = "Show leaderboard by code",
                Foreground = _foregroundButton,
                BackgroundColor = _backgroundColor,
                Margin = new Thickness(_spaceControl, 0, 0, 0)
            };
            leaderboardCodeButton.Click += (s, e) =>
            {
                var code = leaderboardCodeText.Text;
                _socialService.ShowLeaderboard(code);
            };

            var sp4 = new StackPanel
            {
                Orientation = Orientation.Horizontal,
                Margin = new Thickness(100, _topMargin + 5, 0, 0),
            };
            sp4.Add(leaderboardlabel);
            sp4.Add(leaderboardCodeText);
            sp4.Add(leaderboardCodeButton);

            EntityManager.Add(sp4);
        }
Пример #4
0
        protected override void CreateScene()
        {
            RenderManager.BackgroundColor = Color.Gray;
            //RenderManager.DebugLines = true;

            // TextBox Single
            textBoxSingle = new TextBox()
            {
                Margin = new Thickness(20, 20, 0, 0),
                Width = 360,
                Height = 30,
                IsBorder = true,
                BorderColor = Color.White,
                Text = "Haz click para escribir"
            };
            EntityManager.Add(textBoxSingle.Entity);

            // TextBox Multiple 1
            textBoxMultiple1 = new TextBox()
            {
                Margin = new Thickness(20, 100, 0, 0),
                Width = 360,
                Height = 200,
                AcceptsReturn = true,
                IsBorder = true,
                BorderColor = Color.Yellow,
                Background = Color.LightGreen,
                Text = "Un mago nunca llega tarde. Ni pronto. Llega justo cuando se le necesita. by Gandalf",
                TextAlignment = TextAlignment.Right,
                TextWrapping = true,
                Foreground = Color.Green
            };
            EntityManager.Add(textBoxMultiple1.Entity);

            // Button
            button = new Button()
            {
                Margin = new Thickness(20, 320, 0, 0),
                Text = "Clear",
                Foreground = Color.Gray,
                BackgroundColor = Color.LightBlue,
                BorderColor = Color.LightBlue,
            };
            button.Click += button_Click;
            EntityManager.Add(button.Entity);

            // TextBox Multiple 2
            textBoxMultiple2 = new TextBox()
            {
                Margin = new Thickness(20, 380, 0, 0),
                Width = 360,
                Height = 200,
                IsBorder = true,
                BorderColor = Color.Brown,
                AcceptsReturn = true,
                Text = "Un mago nunca llega tarde. Ni pronto. Llega justo cuando se le necesita. by Gandalf",
                TextAlignment = TextAlignment.Center,
                TextWrapping = true,
                Foreground = Color.Brown,
                Background = Color.LightSalmon
            };
            EntityManager.Add(textBoxMultiple2.Entity);

            AddCheckImage("Content/TextBoxSample.wpk");
        }