コード例 #1
0
        void AddSeason()
        {
            SeasonViewModel season = new SeasonViewModel();

            season.Changed += (o, ea) => IsChanged = true;
            season.Number   = Seasons.Any() ? Seasons.Max(p => p.Number) + 1 : 1;

            Seasons.Add(season);
            SelectedSeason = season;
        }
コード例 #2
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;
        }