public AuthorTabViewModel(string FirstName, string LastName, SmallAuthorObject SmallAuthorObject, MainWindowViewModel Parent) { OldSearchFirstName = FirstName; OldSearchLastName = LastName; this.Parent = Parent; Back = new ActionCommand(p => OneBack()); InitAuthor(SmallAuthorObject); }
private void InitAuthor(SmallAuthorObject smallAuthor) { SelectionResult[] tmp = DatabaseAccess.SelectAuthor(smallAuthor.Id); Author = new AuthorObject() { Author = smallAuthor, Information = (AuthorInformationObject)tmp[0], Domicile = (Place)tmp[1], BirthPlace = (Place)tmp[2] }; }
public void NewAuthorTab(string FirstName, string LastName, BaseViewModel bmv, SmallAuthorObject SmallAuthorObject) { Tabs.Remove(SelectedTab); models.Remove(bmv); AuthorTabViewModel atvm = new AuthorTabViewModel(FirstName, LastName, SmallAuthorObject, this); AuthorTabView view = new AuthorTabView(); Tab AuthorTab = new AuthorTab(SmallAuthorObject.FirstName + " " + SmallAuthorObject.LastName) { Content = view, DataContext = atvm }; AuthorTab.IsSelected = true; SelectedTab = AuthorTab; models.Add(atvm); Tabs.Add(AuthorTab); }