private void NewAuthorListTab() { AuthorListTabViewModel altvm = new AuthorListTabViewModel() { Parent = this }; AuthorListTabView view = new AuthorListTabView(); HasContextTab = Visibility.Visible; Tab AuthorListTab = new AuthorListTab() { Content = view, DataContext = altvm }; AuthorListTab.IsSelected = true; models.Add(altvm); this.SelectedTab = AuthorListTab; Tabs.Add(AuthorListTab); }
public void NewAuthorListTab(string FirstName, string LastName, BaseViewModel bmv) { Tabs.Remove(SelectedTab); models.Remove(bmv); AuthorListTabViewModel altvm = new AuthorListTabViewModel(FirstName, LastName) { Parent = this }; AuthorListTabView view = new AuthorListTabView(); Tab AuthorListTab = new AuthorListTab() { Content = view, DataContext = altvm }; AuthorListTab.IsSelected = true; SelectedTab = AuthorListTab; models.Add(altvm); Tabs.Add(AuthorListTab); }