Skip to content

Commit

Permalink
由于发现裁剪闪退问题为解决,因此回退了cc72816
Browse files Browse the repository at this point in the history
  • Loading branch information
autodotua committed Apr 4, 2024
1 parent 18cf13d commit c1abd68
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 193 deletions.
26 changes: 20 additions & 6 deletions SimpleFFmpegGUI.WPF/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,26 @@ protected override void OnStartup(StartupEventArgs e)
ConfigureServices(serviceCollection);
ServiceProvider = serviceCollection.BuildServiceProvider();

ServiceProvider.GetService<FFmpegOutputPageViewModel>();
MainWindow = ServiceProvider.GetService<MainWindow>();
MainWindow.Show();
if (e.Args.Length > 1)
{
if (e.Args[0] == "cut")
{
MainWindow = new CutWindow(new CutWindowViewModel(), e.Args[2..]);
WindowInteropHelper helper = new WindowInteropHelper(MainWindow);
helper.Owner = IntPtr.Parse(e.Args[1]);
MainWindow.ShowDialog();
}
else
{
throw new ArgumentException("未知参数:" + e.Args[0]);
}
}
else
{
ServiceProvider.GetService<FFmpegOutputPageViewModel>();
MainWindow = ServiceProvider.GetService<MainWindow>();
MainWindow.Show();
}
}

private void ConfigureServices(IServiceCollection services)
Expand All @@ -73,9 +90,6 @@ private void ConfigureServices(IServiceCollection services)
services.AddSingleton<MainWindow>();
services.AddTransient<MainWindowViewModel>();

services.AddTransient<CutWindow>();
services.AddTransient<CutWindowViewModel>();

services.AddTransient<TestWindow>();
services.AddTransient<TestWindowViewModel>();

Expand Down
Loading

0 comments on commit c1abd68

Please sign in to comment.