public FileListViewModel(RenamerModel FileRenamerModel, CommandViewModel Move)
        {
            _fileRenamerModel = FileRenamerModel;
            _fileRenamerModel.Files.CollectionChanged += OnCollectionChanged;
            _fileRenamerModel.StrategyChanged         += OnStrategyChanged;

            _move = new CommandViewModel("Move", new RelayCommand(moveCommand));

            AllFiles = new ObservableCollection <FileViewModel>();

            GenerateFiles();
        }
Example #2
0
        public MainWindowViewModel(string[] Files)
        {
            //base.DisplayName = Strings.MainWindowViewModel_DisplayName;

            //_customerRepository = new CustomerRepository(customerDataFile);
            _helpers = new NameExtensionHelper[] {
                NameExtensionHelper.CreateNameExtensionHelper(NameExtensionBehaviour.NameOnly),
                NameExtensionHelper.CreateNameExtensionHelper(NameExtensionBehaviour.ExtensionOnly),
                NameExtensionHelper.CreateNameExtensionHelper(NameExtensionBehaviour.BothNameExtension)
            };

            _renamerModel = new RenamerModel(Files.Select(name => (IFileMetaData) new FileMetaData(name)).ToList());

            _move = new CommandViewModel("Move", new RelayCommand(param => this.Move(param)));

            FileList = new FileListViewModel(_renamerModel, _move);
            _renamerModel.StrategyChanged += FileList.OnStrategyChanged;
            _renamerModel.FilesChanged    += FileList.OnStrategyChanged;
            _renamerModel.Helper           = _helpers[0];
            SelectedStrategy = 0;
        }