Ejemplo n.º 1
0
        public App()
        {
            InitializeComponent();

            new AppDbContext();

            MainPage = new TodoView();
        }
Ejemplo n.º 2
0
        public TodoPage()
        {
            //I don't like my views to be tightly coupled with pages, makes them more portable...personal preference.
            Content = todoView = new TodoView()
            {
                BindingContext = new TodoViewModel(new TodoService())
            };
            BindingContext = todoView.ViewModel;

            addListItem = new ToolbarItem
            {
                Text = "Add List",
            };

            ToolbarItems.Add(addListItem);

            addListItem.SetBinding(ToolbarItem.CommandProperty, nameof(TodoViewModel.AddCommand));
        }