Пример #1
0
        public MainViewModel()
        {
            // Initial startup
            HasProgress = Visibility.Hidden;
            IsBusy      = false;

            // Setup Commands
            LoadImageButton     = new RelayCommand(a => LoadImage(), e => IsNotBusy());
            SelectFiltersButton = new RelayCommand(a => SelectFilters(), e => IsNotBusy());
            ApplyButton         = new RelayCommand(a => ApplyImage(), e => IsNotBusy());
            DetectObjectsButton = new RelayCommand(a => DetectObjects(), e => IsNotBusy());
            SaveButton          = new RelayCommand(a => SaveImage(), e => IsNotBusy());

            // Setup for FilterSelectorWindow with ViewModel
            fsWindow = new FilterSelectorWindow()
            {
                DataContext = new FilterSelectorViewModel()
            };
            decoratedFilter = null;

            // Setup Dialogs
            openImageDialog        = new OpenFileDialog();
            openImageDialog.Filter = "Bitmap files|*.bmp;*.gif;*.png;*.tiff;*.jpg;*.jpeg";

            saveImageDialog        = new SaveFileDialog();
            saveImageDialog.Filter = "Bitmap file|*.bmp";
        }
Пример #2
0
        public MainViewModel()
        {
            // Initial startup
            HasProgress = Visibility.Hidden;
            IsBusy = false;

            // Setup Commands
            LoadImageButton = new RelayCommand(a => LoadImage(), e => IsNotBusy());
            SelectFiltersButton = new RelayCommand(a => SelectFilters(), e => IsNotBusy());
            ApplyButton = new RelayCommand(a => ApplyImage(), e => IsNotBusy());
            DetectObjectsButton = new RelayCommand(a => DetectObjects(), e => IsNotBusy());
            SaveButton = new RelayCommand(a => SaveImage(), e => IsNotBusy());

            // Setup for FilterSelectorWindow with ViewModel
            fsWindow = new FilterSelectorWindow() { DataContext = new FilterSelectorViewModel() };
            decoratedFilter = null;

            // Setup Dialogs
            openImageDialog = new OpenFileDialog();
            openImageDialog.Filter = "Bitmap files|*.bmp;*.gif;*.png;*.tiff;*.jpg;*.jpeg";

            saveImageDialog = new SaveFileDialog();
            saveImageDialog.Filter = "Bitmap file|*.bmp";
        }