Exemple #1
0
        public CollectionPropertyViewModel(TargetPlatform platform, IPropertyInfo property, IEnumerable <IObjectEditor> editors, PropertyVariation variation = null)
            : base(platform, property, editors, variation)
        {
            if (this.cachedProvider == null)
            {
                this.cachedProvider = new CachedEditorProvider(platform.EditorProvider);
            }

            Panel = new PanelViewModel(platform.WithProvider(this.cachedProvider))
            {
                ArrangeMode = PropertyArrangeMode.Category,
                AutoExpand  = true
            };

            AddTargetCommand    = new RelayCommand(OnAddTarget, CanAddTarget);
            RemoveTargetCommand = new RelayCommand(OnRemoveTarget, CanAffectTarget);
            MoveUpCommand       = new RelayCommand(() => MoveTarget(up: true), () => CanMoveTarget(up: true));
            MoveDownCommand     = new RelayCommand(() => MoveTarget(up: false), () => CanMoveTarget(up: false));
            CommitCommand       = new RelayCommand(OnCommitCommand);
            CancelCommand       = new RelayCommand(RequestCurrentValueUpdate);

            RequestTypes();

            this.collectionView.CollectionChanged += OnCollectionViewContentsChanged;

            UpdateSelectedTarget();
        }
        public ArrangeModeViewModel(PropertyArrangeMode arrangeMode, PanelViewModel parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            this.parent = parent;
            this.parent.PropertyChanged += OnParentPropertyChanged;
            ArrangeMode = arrangeMode;
        }