Exemplo n.º 1
0
        public TextTaskView(TextTaskTable textTask)
        {
            var kernel = new StandardKernel();

            _db = kernel.Get <DatabaseHelper> ();

            Padding = AppSettings.TaskPadding;

            AnswerLabel        = new AnswerLabel();
            AnswerLabel.Text   = textTask.NextTaskUnlockCode.ToString();
            NextTaskUnlockCode = textTask.NextTaskUnlockCode.ToString();

            AnswerAndReturnButton = new AnswerButton {
                Text = "Unlock Next Task"
            };
            AnswerAndReturnButton.Clicked += AnswerAndReturnButton_Clicked;

            taskId = textTask.Id;

            var gesture = new TapGestureRecognizer();

            gesture.Tapped += BackTap;

            var home = new Label {
                Text = "<-- HOME",
                HorizontalOptions = HorizontalOptions
            };

            home.GestureRecognizers.Add(gesture);
            Children.Add(home);

            Children.Add(
                new TaskHeader {
                Text = textTask.Name
            }
                );

            Children.Add(
                new TaskLabel {
                Text = textTask.Text
            }
                );

            Children.Add(AnswerLabel);
            Children.Add(AnswerAndReturnButton);
        }
Exemplo n.º 2
0
        public TextTaskView(TextTaskTable textTask)
        {
            var kernel = new StandardKernel();
            _db = kernel.Get<DatabaseHelper> ();

            Padding = AppSettings.TaskPadding;

            AnswerLabel = new AnswerLabel ();
            AnswerLabel.Text = textTask.NextTaskUnlockCode.ToString ();
            NextTaskUnlockCode = textTask.NextTaskUnlockCode.ToString ();

            AnswerAndReturnButton = new AnswerButton{	Text = "Unlock Next Task" };
            AnswerAndReturnButton.Clicked += AnswerAndReturnButton_Clicked;

            taskId = textTask.Id;

            var gesture = new TapGestureRecognizer();

            gesture.Tapped += BackTap;

            var home = new Label {
                Text = "<-- HOME",
                HorizontalOptions = HorizontalOptions
            };

            home.GestureRecognizers.Add (gesture);
            Children.Add (home);

            Children.Add (
                new TaskHeader {
                    Text = textTask.Name
                }
            );

            Children.Add (
                new TaskLabel {
                    Text = textTask.Text
                }
            );

            Children.Add (AnswerLabel);
            Children.Add (AnswerAndReturnButton);
        }