public MainWindow()
        {
            InitializeComponent();
            var data = new ShoppingListData();

            data.Add("Bananas");
            this.DataContext = data;
        }
示例#2
0
        public MainWindow()
        {
            var data = new ShoppingListData();

            data.Add("Diapers");
            data.Add("Formula");
            DataContext = data;
            InitializeComponent();
        }
        public MainWindow()
        {
            InitializeComponent();

            var data = new ShoppingListData();

            data.Add("Shrimp");
            data.Add("Potatoes");
            DataContext = data;
        }
示例#4
0
        public MainWindow()
        {
            InitializeComponent();

            var data = new ShoppingListData();

            data.Add("Bananas");
            data.Add("Formula");
            this.DataContext = data; // every xaml object has data context
        }
示例#5
0
        public MainWindow()
        {
            InitializeComponent();

            var data = new ShoppingListData();

            data.Add("Bananas");
            data.Add("Formula");

            this.DataContext = data; //EVERY xaml component has a data context, can inherit its parents or be set to its own
        }
        public MainWindow()
        {
            InitializeComponent();

            DataContext = new ShoppingListData();

            var data = new ShoppingListData();

            data.Add("Big Chungus ps4");
            DataContext = data;
        }
示例#7
0
        public MainWindow()
        {
            InitializeComponent();

            var data = new ShoppingListData();

            data.Add("Bananas");
            data.Add("Formula");

            // binding object as data source for window:
            this.DataContext = data;
        }