private void RemoveSolution_OnClick(object sender, RoutedEventArgs e) { BuildTabItem tab = (BuildTabItem)tabs.SelectedContent; int index = tab.SelectedSolutionIndex; if (index >= 0 && index < tab.Solutions.Count) { var solutions = _Model.Scope2SolutionObjects[tab.TabName]; solutions.RemoveAt(index); tab.Solutions.RemoveAt(index); } }
private void MnuNewTab_Click(object sender, RoutedEventArgs e) { var dialog = new ListViewQueryDialog("New Tab") { Owner = this }; dialog.Entries.Add(new SettingsPair("Name", "")); dialog.Entries.Add(new SettingsPair("Base dir", "")); if (dialog.ShowDialog() == true) { String tabName = dialog.Entries.FirstOrDefault(x => x.Key == "Name").Value; if (tabName == null && tabName.Length <= 0) { return; } BuildTabItem tab = new BuildTabItem() { TabName = tabName }; tab.BindToModel(ref _Model, ref _ViewModel); _ViewModel.Tabs.Add(tab); } }