Inheritance: ViewModelBase, ITreeNodeViewModel
Ejemplo n.º 1
0
        public TaskMappingConfigurationViewModel(IReadOnlyList <string> availableCategories, TaskMappingConfigurationModel model, IViewOptions viewOptions)
        {
            if (availableCategories == null)
            {
                throw new ArgumentNullException(nameof(availableCategories));
            }
            if (viewOptions == null)
            {
                throw new ArgumentNullException(nameof(viewOptions));
            }

            AvailableCategories = availableCategories;
            _model      = model;
            ViewOptions = viewOptions;

            _customPropertyMappingViewModel = new CustomPropertyMappingViewModel(model);
            Items = new[] { _customPropertyMappingViewModel };


            RegisterPropertyChangePropagation(_model, nameof(_model.MapBody), nameof(MapBody));
            RegisterPropertyChangePropagation(_model, nameof(_model.MapPriority), nameof(MapPriority));
            RegisterPropertyChangePropagation(_model, nameof(_model.MapRecurringTasks), nameof(MapRecurringTasks));
            RegisterPropertyChangePropagation(_model, nameof(_model.MapReminder), nameof(MapReminder));
            RegisterPropertyChangePropagation(_model, nameof(_model.TaskCategory), nameof(TaskCategory));
            RegisterPropertyChangePropagation(_model, nameof(_model.UseTaskCategoryAsFilter), nameof(UseTaskCategoryAsFilter));
            RegisterPropertyChangePropagation(_model, nameof(_model.IncludeEmptyTaskCategoryFilter), nameof(IncludeEmptyTaskCategoryFilter));
            RegisterPropertyChangePropagation(_model, nameof(_model.InvertTaskCategoryFilter), nameof(InvertTaskCategoryFilter));
            RegisterPropertyChangePropagation(_model, nameof(_model.IsCategoryFilterSticky), nameof(IsCategoryFilterSticky));
        }
Ejemplo n.º 2
0
        public EventMappingConfigurationViewModel(IReadOnlyList <string> availableCategories, ICurrentOptions currentOptions)
        {
            if (availableCategories == null)
            {
                throw new ArgumentNullException(nameof(availableCategories));
            }
            if (currentOptions == null)
            {
                throw new ArgumentNullException(nameof(currentOptions));
            }

            AvailableCategories           = availableCategories;
            _currentOptions               = currentOptions;
            SetServerCalendarColorCommand = new DelegateCommand(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                SetServerCalendarColorAsync();
            });
            GetServerCalendarColorCommand = new DelegateCommand(_ =>
            {
                ComponentContainer.EnsureSynchronizationContext();
                GetServerCalendarColorAsync();
            });

            _customPropertyMappingViewModel = new CustomPropertyMappingViewModel();
            Items = new[] { _customPropertyMappingViewModel };
        }
        public TaskMappingConfigurationViewModel(IReadOnlyList <string> availableCategories)
        {
            if (availableCategories == null)
            {
                throw new ArgumentNullException(nameof(availableCategories));
            }

            AvailableCategories = availableCategories;

            _customPropertyMappingViewModel = new CustomPropertyMappingViewModel();
            Items = new[] { _customPropertyMappingViewModel };
        }
    public EventMappingConfigurationViewModel (IReadOnlyList<string> availableCategories, ICurrentOptions currentOptions)
    {
      if (availableCategories == null)
        throw new ArgumentNullException (nameof (availableCategories));
      if (currentOptions == null)
        throw new ArgumentNullException (nameof (currentOptions));

      AvailableCategories = availableCategories;
      _currentOptions = currentOptions;
      SetServerCalendarColorCommand = new DelegateCommand (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        SetServerCalendarColorAsync();
      });
      GetServerCalendarColorCommand = new DelegateCommand (_ =>
      {
        ComponentContainer.EnsureSynchronizationContext();
        GetServerCalendarColorAsync();
      });

      _customPropertyMappingViewModel = new CustomPropertyMappingViewModel();
      Items = new[] {_customPropertyMappingViewModel};
    }