public MainViewModel()
        {
            DisplayName       = "MainViewModel";
            DuplicateFileList = new ObservableCollection <FileDetail>();
            ErrorList         = new ObservableCollection <string>();

            _dirFileEnumeration            = new DirFileEnumeration(this);
            _dirFileEnumeration.FileFound += _dirFileEnumeration_FileFound;

            this.CanScanFiles      = false;
            this.ScanButtonCaption = "Begin Scan";
            this.IsScanInProgress  = false;
        }
Example #2
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.Title = "Duplicate File Detector \u00A9Kavitesh Singh 2016";

            //throw new NotImplementedException();
            Console.WriteLine("");
            workerThread = new BackgroundWorker();
            workerThread.WorkerReportsProgress = true;
            workerThread.DoWork             += workerThread_DoWork;
            workerThread.RunWorkerCompleted += workerThread_RunWorkerCompleted;
            workerThread.ProgressChanged    += workerThread_ProgressChanged;

            // Create InMemory DB.
            _dbEngine = new DBEngine();
            _dbEngine.CreateInMemoryDB();

            _dirEnum            = new DirFileEnumeration();
            _dirEnum.FileFound += DirEnum_FileFound;

            DataModel = new DataViewModel();
            ResultDataGrid.ItemsSource = DataModel.DuplicateFileList;
        }