private ListItem CreateProgramItem(IProgram program, ISchedule schedule)
    {
      ProgramProperties programProperties = new ProgramProperties();
      IProgram currentProgram = program;
      programProperties.SetProgram(currentProgram);

      ListItem item = new ProgramListItem(programProperties)
      {
        Command = new MethodDelegateCommand(() => ShowActions(schedule, program))
      };
      IChannel channel;
      if (_tvHandler.ChannelAndGroupInfo.GetChannel(currentProgram.ChannelId, out channel))
        item.SetLabel("ChannelName", channel.Name);
      item.SetLabel("ScheduleType", string.Format("[SlimTvClient.ScheduleRecordingType_{0}]", schedule.RecordingType));
      item.AdditionalProperties["PROGRAM"] = currentProgram;
      item.AdditionalProperties["SCHEDULE"] = schedule;
      return item;
    }
    private void FillProgramsList()
    {
      _programsList.Clear();

      bool isSingle = false;
      bool isSeries = false;
      foreach (IProgram program in _programs)
      {
        // Use local variable, otherwise delegate argument is not fixed
        ProgramProperties programProperties = new ProgramProperties();
        IProgram currentProgram = program;
        programProperties.SetProgram(currentProgram);

        if (ProgramComparer.Instance.Equals(_selectedProgram, program))
        {
          isSingle = programProperties.IsScheduled;
          isSeries = programProperties.IsSeriesScheduled;
        }

        ProgramListItem item = new ProgramListItem(programProperties)
        {
          Command = new MethodDelegateCommand(() => CreateOrDeleteSchedule(currentProgram))
        };
        item.AdditionalProperties["PROGRAM"] = currentProgram;
        item.Selected = _lastProgramId == program.ProgramId; // Restore focus
        IChannel channel;
        if (_tvHandler.ChannelAndGroupInfo.GetChannel(program.ChannelId, out channel))
          item.SetLabel("ChannelName", channel.Name);

        _programsList.Add(item);
      }

      // "Record" buttons are related to properties, for schedules we need to keep them to "Cancel record" state.
      if (_isScheduleMode)
        isSingle = isSeries = _selectedSchedule != null;

      IsSingleRecordingScheduled = isSingle;
      IsSeriesRecordingScheduled = isSeries;

      _programsList.FireChange();
    }