示例#1
0
        public CharacterDetailPage()
        {
            InitializeComponent();

            // create and initialize new data
            var data = new Character
            {
                Id = Guid.NewGuid().ToString(),

                name           = "Dan",
                description    = "Dan is the man",
                characterClass = "paladin",
            };

            data.attributes.defense           = 1;
            data.attributes.alive             = true;
            data.attributes.attack            = 1;
            data.attributes.attackModifier    = 1;
            data.attributes.currentExperience = 0;
            data.attributes.currentHealth     = 10;
            data.attributes.currentExperience = 0;
            data.attributes.defenseModifier   = 1;
            data.attributes.health            = 10;
            data.attributes.level             = 1;
            data.attributes.speed             = 1;
            data.attributes.speedModifier     = 1;

            _viewModel     = new CharacterDetailViewModel(data);
            BindingContext = _viewModel;
        }
        public DeleteCharacterPage(CharacterDetailViewModel viewModel)
        {
            // Save off the item
            Data            = viewModel.Data;
            viewModel.Title = "Delete " + viewModel.Title;

            InitializeComponent();

            // Set the data binding for the page
            BindingContext = _viewModel = viewModel;
        }
示例#3
0
        public CharacterDetailPage(CharacterDetailViewModel viewModel)
        {
            InitializeComponent();

            BindingContext = _viewModel = viewModel;
        }