public BookViewModel(BookToken token) { Requires.NotNull(token, nameof(token)); Token = token; Sheets = new ObservableCollection <SheetViewModel>(); Windows = new BookWindowsViewModel(); Activate = new RelayCommand(obj => SessionCommands.ActivateBook(Token.Id)); }
public static BookWindowsViewModel GetBookWindows(BookToken token) { Requires.NotNull(token, nameof(token)); var result = new BookWindowsViewModel(); foreach (var windowToken in token.Windows) { result.Windows.Add(ConvertWindow(windowToken)); } return(result); }