示例#1
0
        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();
        }
示例#2
0
        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);
        }
示例#3
0
        public ProgressViewModel(
            ResizeBatch batch,
            MainViewModel mainViewModel,
            IMainView mainView)
        {
            _batch         = batch;
            _mainViewModel = mainViewModel;
            _mainView      = mainView;

            StartCommand = new RelayCommand(Start);
            StopCommand  = new RelayCommand(Stop);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
        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();
        }
示例#7
0
 public MainViewModel(ResizeBatch batch, Settings settings)
 {
     _batch      = batch;
     _settings   = settings;
     LoadCommand = new RelayCommand <IMainView>(Load);
 }
示例#8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var batch = ResizeBatch.FromCommandLine(Console.In, e.Args);

            new MainWindow(new MainViewModel(batch, Settings.Default)).Show();
        }