コード例 #1
0
        public CreateRiddlePage(IRiddleService riddleService)
        {
            _riddleService = riddleService;

            Title = "Add Riddle";

            StackLayout stackLayout = new StackLayout();

            _descriptionEntry = new Entry
            {
                Keyboard    = Keyboard.Text,
                Placeholder = "what's the difference between...?"
            };

            _answerEntry = new Entry
            {
                Keyboard    = Keyboard.Text,
                Placeholder = "ex: hot, poop, pot, hoop"
            };

            _saveButton = new Button
            {
                Text = "Add"
            };

            _saveButton.Clicked += _submitRiddle;

            stackLayout.Children.Add(_descriptionEntry);
            stackLayout.Children.Add(_answerEntry);
            stackLayout.Children.Add(_saveButton);

            Content = stackLayout;
        }
コード例 #2
0
        public RiddleListPage(IRiddleService riddleService, IAnswerService answerService)
        {
            _riddleService = riddleService;
            _answerService = answerService;

            Title = "Spooneritis";

            StackLayout stackLayout = new StackLayout();

            _listView = new ListView();

            stackLayout.Children.Add(_listView);

            Content = stackLayout;
        }