Beispiel #1
0
        public void Initialize(ViewRequest viewRequest)
        {
            var request = viewRequest as IssueViewRequest;

            scope = request.Scope;

            var issueId = request?.IssueId;

            if (issueId == 0)
            {
                issueId = null;
            }

            Observable.FromAsync(() => scope.LoadOrCreateAsync(issueId))
            .ObserveOnDispatcher()
            .Subscribe(issue =>
                       mapper.Map(issue, this));

            Observable.FromAsync(() => scope.GetRows())
            .ObserveOnDispatcher()
            .Subscribe(rows =>
            {
                AwailableRows.Clear();
                AwailableRows.AddRange(rows);
            });

            Observable.FromAsync(() => scope.GetColumns())
            .ObserveOnDispatcher()
            .Subscribe(columns =>
                       AwailableColumns.PublishCollection(columns));

            Title = $"Редактирование задачи {Head}";
        }