public MovieViewModel(Movie movie) : base() { ID = movie.ID; RTitle = movie.RTitle; OTitle = movie.OTitle; Year = movie.Year; Note = movie.Note; Description = movie.Description; Link = movie.Link; Type = movie.Type; KinopoiskId = movie.KinopoiskId; Rating = new RatingWithKinopoiskViewModel(movie.Rating, movie.KinopoiskRating, movie.IMDBRating); States = new StateItemsViewModel(StatesDict); foreach (var s in States.Items) { var st = movie.States.FirstOrDefault(p => p.Name == s.Key); if (st != null) { s.Value.IsDone = true; s.Value.Date = st.Date; s.Value.IsChanged = false; } } States.GetLastState(); PrepareViewModel(); }
public MovieViewModel() : base() { Year = DateTime.Today.Year; Type = TypeEnum.NA; Rating = new RatingWithKinopoiskViewModel(); States = new StateItemsViewModel(StatesDict); PrepareViewModel(); }
public SeasonViewModel(Season season) { Number = season.Number; Episodes = season.Episodes; Note = season.Note; States = new StateItemsViewModel(StatesDict); foreach (var s in States.Items) { var st = season.States.FirstOrDefault(p => p.Name == s.Key); if (st != null) { s.Value.IsDone = true; s.Value.Date = st.Date; s.Value.IsChanged = false; } } States.GetLastState(); States.Changed += (o, ea) => IsChanged = true; IsChanged = false; }
public GameViewModel(Game game) : base() { ID = game.ID; Title = game.Title; Note = game.Note; Description = game.Description; PlayTime = game.PlayTime; Rating = new RatingViewModel(game.Rating); States = new StateItemsViewModel(StatesDict); foreach (var s in States.Items) { var st = game.States.FirstOrDefault(p => p.Name == s.Key); if (st != null) { s.Value.IsDone = true; s.Value.Date = st.Date; s.Value.IsChanged = false; } } States.GetLastState(); PrepareViewModel(); }
public GameViewModel() : base() { Rating = new RatingWithKinopoiskViewModel(); States = new StateItemsViewModel(StatesDict); PrepareViewModel(); }
public SeasonViewModel() { States = new StateItemsViewModel(StatesDict); States.Changed += (o, ea) => IsChanged = true; IsChanged = false; }