Example #1
0
        public ActionViewModel(QuickMediaSorterProjectBatch batch, string basePath)
        {
            _batch = batch;
            //Refresh();

            EditInNewWindowCommand = new RelayCommand(OpenEditInNewWindow);

            ActionTypes = Enum.GetNames(typeof(QuickMediaSorter.ObjectModel.ActionType));

            PathBrowserViewModel                = new PathBrowserViewModel();
            PathBrowserViewModel.BasePath       = basePath;
            PathBrowserViewModel.Path           = Action.Folder;
            PathBrowserViewModel.OnPathChanged += (s, e) =>
            {
                Action.Path = PathBrowserViewModel.Path;
                Refresh();
            };
        }
Example #2
0
        public MainViewModel(QuickMediaSorterProject qms)
        {
            _qms = qms;
            ImagesViewViewModel = new ImagesViewModel(qms);

            // get the list of actions
            var lst = new List <QuickMediaSorterProjectBatch>(qms.Batch);

            // create a list of view models
            UserActions = new ObservableCollection <ActionViewModel>(lst.Select(a => new ActionViewModel(a, qms.Path)));

            SaveCommand      = new RelayCommand(Save);
            AddActionCommand = new RelayCommand(AddNewAction);

            PathBrowserViewModel                = new PathBrowserViewModel();
            PathBrowserViewModel.Path           = _qms.Path;
            PathBrowserViewModel.OnPathChanged += (s, e) => { Refresh(); };
        }