示例#1
0
        public void ToQuestPage(AbstractQuest questToDisplay)
        {
            if (questToDisplay is null)
            {
                throw new ArgumentNullException(nameof(questToDisplay));
            }

            var ViewModel = new QuestPageViewModel(questToDisplay, this);
            var QuestPage = new Views.QuestPage(ViewModel);

            Application.Current.MainPage.Navigation.PushAsync(QuestPage);
        }
示例#2
0
        public QuestPage(QuestPageViewModel viewModel)
        {
            InitializeComponent();

            if (viewModel is null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }

            this.ViewModel = viewModel;

            var DeleteQuestButton = new ToolbarItem("Delete Quest", "UpIcon.png", () => { }, ToolbarItemOrder.Primary);

            DeleteQuestButton.Command = ViewModel.DeleteQuestCommand;
            this.ToolbarItems.Add(DeleteQuestButton);

            SetMainQuestViewBindings(ViewModel.displayedQuest, this.MainQuestDetailView);
        }