protected override void OnStartup(StartupEventArgs e) { var batch = ResizeBatch.FromCommandLine(Console.In, e.Args); // TODO: Add command-line parameters that can be used in lieu of the input page (issue #14) new MainWindow(new MainViewModel(batch, Settings.Default)).Show(); }
protected override void OnStartup(StartupEventArgs e) { var batch = ResizeBatch.FromCommandLine(Console.In, e.Args); // TODO: Add command-line parameters that can be used in lieu of the input page (issue #14) var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default)); mainWindow.Show(); // Temporary workaround for issue #1273 BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle); }
public ProgressViewModel( ResizeBatch batch, MainViewModel mainViewModel, IMainView mainView) { _batch = batch; _mainViewModel = mainViewModel; _mainView = mainView; StartCommand = new RelayCommand(Start); StopCommand = new RelayCommand(Stop); }
public InputViewModel( Settings settings, MainViewModel mainViewModel, IMainView mainView, ResizeBatch batch) { _batch = batch; _mainViewModel = mainViewModel; _mainView = mainView; Settings = settings; settings.CustomSize.PropertyChanged += (sender, e) => settings.SelectedSize = (CustomSize)sender; ResizeCommand = new RelayCommand(Resize); CancelCommand = new RelayCommand(Cancel); }
protected override void OnStartup(StartupEventArgs e) { // Fix for .net 3.1.19 making Image Resizer not adapt to DPI changes. NativeMethods.SetProcessDPIAware(); var batch = ResizeBatch.FromCommandLine(Console.In, e?.Args); // TODO: Add command-line parameters that can be used in lieu of the input page (issue #14) var mainWindow = new MainWindow(new MainViewModel(batch, Settings.Default)); mainWindow.Show(); _themeManager = new ThemeManager(this); // Temporary workaround for issue #1273 BecomeForegroundWindow(new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle); }
public InputViewModel( Settings settings, MainViewModel mainViewModel, IMainView mainView, ResizeBatch batch) { _batch = batch; _mainViewModel = mainViewModel; _mainView = mainView; Settings = settings; if (settings != null) { settings.CustomSize.PropertyChanged += (sender, e) => settings.SelectedSize = (CustomSize)sender; } ResizeCommand = new RelayCommand(Resize); CancelCommand = new RelayCommand(Cancel); ShowAdvancedCommand = new RelayCommand(ShowAdvanced); ShowAdvancedSettings = !AdvancedSettings.UseNewSettings(); }
public MainViewModel(ResizeBatch batch, Settings settings) { _batch = batch; _settings = settings; LoadCommand = new RelayCommand <IMainView>(Load); }
protected override void OnStartup(StartupEventArgs e) { var batch = ResizeBatch.FromCommandLine(Console.In, e.Args); new MainWindow(new MainViewModel(batch, Settings.Default)).Show(); }