private void LoadDummyButtonData() { for (int counter = 0; counter < 2; counter++) { SampleView newView = new SampleView(); newView.LabelText = "View #" + counter.ToString(); this.testViews.Add(newView); } for (int counter = 0; counter < 2; counter++) { ModelObject model = new ModelObject(); model.Name = "Model View #" + counter.ToString(); if (model.Name == "Model View #1") model.AllowClose = true; else model.AllowClose = false; this.testViews.Add(model); } }
private void Button_Click(object sender, RoutedEventArgs e) { ModelObject mo = new ModelObject(); mo.Name = "Model View # " + (this.tabControl.Items.OfType<ModelObject>().Count()).ToString(); mo.AllowClose = true; testViews.Add(mo); }