Example #1
0
        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();
        }
Example #2
0
        public MovieViewModel() : base()
        {
            Year   = DateTime.Today.Year;
            Type   = TypeEnum.NA;
            Rating = new RatingWithKinopoiskViewModel();
            States = new StateItemsViewModel(StatesDict);

            PrepareViewModel();
        }
Example #3
0
        public SerialViewModel() : base()
        {
            PrepareViewModel();

            CreateDate      = DateTime.Today;
            Rating          = new RatingWithKinopoiskViewModel(0, null, null);
            Rating.Changed += (o, ea) => IsChanged = true;
            IsChanged       = false;
        }
Example #4
0
        public SerialViewModel(Serial serial) : base()
        {
            PrepareViewModel();

            ID            = serial.ID;
            RTitle        = serial.RTitle;
            OTitle        = serial.OTitle;
            Note          = serial.Note;
            HasLastSeason = serial.HasLastSeason;
            CreateDate    = serial.CreateDate;
            Description   = serial.Description;
            KinopoiskId   = serial.KinopoiskId;
            Rating        = new RatingWithKinopoiskViewModel(0, serial.KinopoiskRating, serial.IMDBRating);
            foreach (var i in serial.Seasons)
            {
                var st = new SeasonViewModel(i);
                st.Changed += (o, ea) => IsChanged = true;
                Seasons.Add(st);
            }
            Rating.Changed += (o, ea) => IsChanged = true;
            IsChanged       = false;
        }
Example #5
0
 public GameViewModel() : base()
 {
     Rating = new RatingWithKinopoiskViewModel();
     States = new StateItemsViewModel(StatesDict);
     PrepareViewModel();
 }