public SlotDetailsContentViewModel(ReservationService reservationService)
 {
     _reservationService = reservationService;
     ResponseRequest     = new InteractionRequest <DataPassingNotification>();
     Cast      = new ObservableCollection <string>();
     Staff     = new ObservableCollection <string>();
     _reserved = new[] { false, false };
     ViewModelHelper.Subscribe(this, w => w.Notification, w =>
     {
         _model = RawNotification.Model as WrapSlot;
         if (_model == null)
         {
             return;
         }
         _reserved = new[] { false, false };
         Cast.Clear();
         Staff.Clear();
         _model.RequestDetails();
         WindowTitle = $"{_model.Title} - {Resources.ProgramDetails} - Norma";
         Title       = _model.Title;
         Date        = _model.FixedStartAt.ToString("MM/DD");
         Time        = $"{_model.StartAt.ToString("MM/dd HH:mm")} ~ {_model.EndAt.ToString("MM/dd HH:mm")}";
         Description = _model.Description;
         _model.Casts.ForEach(x => Cast.Add(x));
         _model.Crews.ForEach(x => Staff.Add(x));
         Thumbnail = $"https://hayabusa.io/abema/programs/{_model.ProgramId}/thumb001.w200.h112.jpg";
         Channel   = _model.Channel.Name;
         RegisterSlotReservationCommand.RaiseCanExecuteChanged();
         RegisterSeriesReservationCommand.RaiseCanExecuteChanged();
     }).AddTo(this);
 }
Пример #2
0
        public EpisodeCellViewModel(WrapSlot program)
        {
            Model = program;
            var span = Model.FixedEndAt - Model.FixedStartAt;

            Height = span.Hours * 60 * 3 + span.Minutes * 3;
            Top    = Model.FixedStartAt.Hour * 60 * 3 + Model.FixedStartAt.Minute * 3;
        }