|
@@ -1,5 +1,4 @@
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
-using ModernWpf;
|
|
|
|
using ModernWpf.Controls;
|
|
using ModernWpf.Controls;
|
|
using NatTypeTester.ViewModels;
|
|
using NatTypeTester.ViewModels;
|
|
using ReactiveUI;
|
|
using ReactiveUI;
|
|
@@ -13,13 +12,10 @@ namespace NatTypeTester
|
|
{
|
|
{
|
|
public partial class MainWindow : ISingletonDependency
|
|
public partial class MainWindow : ISingletonDependency
|
|
{
|
|
{
|
|
- public IServiceProvider ServiceProvider { get; set; } = null!;
|
|
|
|
-
|
|
|
|
- public MainWindow(MainWindowViewModel viewModel)
|
|
|
|
|
|
+ public MainWindow(MainWindowViewModel viewModel, IServiceProvider serviceProvider)
|
|
{
|
|
{
|
|
InitializeComponent();
|
|
InitializeComponent();
|
|
ViewModel = viewModel;
|
|
ViewModel = viewModel;
|
|
- ThemeManager.Current.ApplicationTheme = default;
|
|
|
|
|
|
|
|
this.WhenActivated(d =>
|
|
this.WhenActivated(d =>
|
|
{
|
|
{
|
|
@@ -43,7 +39,7 @@ namespace NatTypeTester
|
|
{
|
|
{
|
|
if (args.EventArgs.IsSettingsSelected)
|
|
if (args.EventArgs.IsSettingsSelected)
|
|
{
|
|
{
|
|
- ViewModel.Router.Navigate.Execute(ServiceProvider.GetRequiredService<SettingViewModel>());
|
|
|
|
|
|
+ ViewModel.Router.Navigate.Execute(serviceProvider.GetRequiredService<SettingViewModel>());
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -56,12 +52,12 @@ namespace NatTypeTester
|
|
{
|
|
{
|
|
case @"1":
|
|
case @"1":
|
|
{
|
|
{
|
|
- ViewModel.Router.Navigate.Execute(ServiceProvider.GetRequiredService<RFC5780ViewModel>());
|
|
|
|
|
|
+ ViewModel.Router.Navigate.Execute(serviceProvider.GetRequiredService<RFC5780ViewModel>());
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
case @"2":
|
|
case @"2":
|
|
{
|
|
{
|
|
- ViewModel.Router.Navigate.Execute(ServiceProvider.GetRequiredService<RFC3489ViewModel>());
|
|
|
|
|
|
+ ViewModel.Router.Navigate.Execute(serviceProvider.GetRequiredService<RFC3489ViewModel>());
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|