public ReportViewModel(TaskLogApplicationService service, ReportTarget reportTarget)
        {
            ObservableCollection <PeriodViewModel> periods = new ObservableCollection <PeriodViewModel>();
            PeriodViewModel      period         = PeriodViewModel.Create(reportTarget.Period);
            var                  targets        = new ObservableCollection <TaskReportItemViewModel>();
            TaskSpecifyViewModel reportTargetVm = TaskSpecifyViewModel.Create(reportTarget.TaskSpecify);

            if (reportTarget.TaskSpecify is IndividualTaskSpecify)
            {
                foreach (var x in ((IndividualTaskSpecify)reportTarget.TaskSpecify).TargetTasks)
                {
                    targets.Add(new TaskReportItemViewModel(x.TaskKeyword, x.SearchMethod, 0));
                }
            }
            Init(service, reportTarget.Title, period, reportTargetVm, targets);
        }
        public void Init(TaskLogApplicationService service, string title, PeriodViewModel period, TaskSpecifyViewModel taskSpecify, ObservableCollection <TaskReportItemViewModel> targets)
        {
            this.service     = service;
            this.TaskReports = targets;
            this.Title       = title;
            Periods          = new ObservableCollection <PeriodViewModel>();
            Periods.Add(ItselfOrDefault <WholePeriodViewModel>(period));
            Periods.Add(ItselfOrDefault <PartialPeriodViewModel>(period));
            Periods.Add(ItselfOrDefault <DatePeriodViewModel>(period));
            this.Period = period != null ? period : Periods[0];

            TaskSpecifies = new ObservableCollection <TaskSpecifyViewModel>();
            TaskSpecifies.Add(ItselfOrDefault <AllTaskSpecifyViewModel>(taskSpecify));
            TaskSpecifies.Add(ItselfOrDefault <AllTaskSpecifyByKeywordViewModel>(taskSpecify));
            TaskSpecifies.Add(ItselfOrDefault <IndividualTaskSpecifyViewModel>(taskSpecify));
            this.TaskSpecify = taskSpecify != null ? taskSpecify :TaskSpecifies[0];

            ReportCommand = new DelegateCommand(
                (_) =>
            {
                var report = service.CreateReport(Period.Create(), TaskSpecify.Create(CreateTaskSearhMethods()));
                Update(report);
            });
            AddRowCommand = new DelegateCommand(
                (_) =>
            {
                TaskReports.Add(new TaskReportItemViewModel());
            });
            //Update();
        }