public ScanSettingsViewModel(ScanDocumentViewModel <TDocument> scanDocumentViewModel) { _scanDocumentViewModel = scanDocumentViewModel; ImageColorModeSource = ScanHelper.CreateImageColorModeSource(); SelectDeviceSource = ScanHelper.CreateSelectDeviceSource(); ShowScanDialogSource = ScanHelper.CreateShowScanDialogSource(); ImageResolutionSource = ScanHelper.CreateImageDPISource(); ScanSettings = scanDocumentViewModel.ScanSettings; }
public ScanDocumentViewModel(ICollectionRepository <TDocument, Guid> documentsRepository, ScanSettings scanSettings) { _documentsRepository = documentsRepository; ScanSettings = scanSettings; var imageDisplayModes = ScanHelper.CreateImageDisplayModeSource(); _imageStretchUniformToFill = imageDisplayModes.FirstOrDefault(i => i.Stretch == Stretch.UniformToFill); _imageStretchNoneButScale = imageDisplayModes.FirstOrDefault(i => i.Stretch == Stretch.None); ImageColorModeSource = ScanHelper.CreateImageColorModeSource(); ImageQualitySource = ScanHelper.CreateImageQualitySource(); ImageQuality = ImageQualitySource.FirstOrDefault(i => i.Default); ImageFormatsSource = ImageFileFormat.Formats; ScanEnabled = true; QualityEnabled = false; AutoScale = true; ImageScaleRatio = 1; ImageFormatItem = ImageFormatsSource.FirstOrDefault(i => Equals(i.ImageFormat, _defaultImageFormat)); }