public ProjectItemViewModel(T model)
        {
            Model = model;

            RemoveItemCommand = ReactiveCommand.Create();
            RemoveItemCommand.Subscribe(o =>
            {
            });

            OpenInExplorerCommand = ReactiveCommand.Create();
            OpenInExplorerCommand.Subscribe(o =>
            {
                if (model is IProjectFolder)
                {
                    Platform.OpenFolderInExplorer((model as IProjectFolder).Location);
                }
                else if (model is IProjectItem)
                {
                    Platform.OpenFolderInExplorer((model as IProjectItem).Parent.Location);
                }
            });

            textBoxVisibility = false;
            labelVisibility   = true;
        }
Esempio n. 2
0
        public MainWindowViewModel()
        {
            this.WhenAnyValue(x => x.ItemCount).Subscribe(ResizeItems);
            RecreateCommand = ReactiveCommand.Create();
            RecreateCommand.Subscribe(_ => Recreate());

            AddItemCommand = ReactiveCommand.Create();
            AddItemCommand.Subscribe(_ => AddItem());

            RemoveItemCommand = ReactiveCommand.Create();
            RemoveItemCommand.Subscribe(_ => Remove());

            SelectFirstCommand = ReactiveCommand.Create();
            SelectFirstCommand.Subscribe(_ => SelectItem(0));

            SelectLastCommand = ReactiveCommand.Create();
            SelectLastCommand.Subscribe(_ => SelectItem(Items.Count - 1));
        }