public MainWindow() { InitializeComponent(); var data = new ShoppingListData(); data.Add("Bananas"); this.DataContext = data; }
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; }
public MainWindow() { InitializeComponent(); var data = new ShoppingListData(); data.Add("Bananas"); data.Add("Formula"); this.DataContext = data; // every xaml object has data context }
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; }
public MainWindow() { InitializeComponent(); var data = new ShoppingListData(); data.Add("Bananas"); data.Add("Formula"); // binding object as data source for window: this.DataContext = data; }