55using Codebreaker . ViewModels ;
66using Codebreaker . ViewModels . Contracts . Services ;
77using Codebreaker . ViewModels . Services ;
8- using CodeBreaker . Avalonia . Contracts . Services . Navigation ;
98using CodeBreaker . Avalonia . Services ;
109using CodeBreaker . Avalonia . Services . Navigation ;
1110using CodeBreaker . Avalonia . Views ;
1817namespace CodeBreaker . Avalonia ;
1918public partial class App : Application
2019{
21- private readonly IHost _host ;
22-
2320 public App ( )
2421 {
2522 this . SetDotnetEnvironmentVariable ( ) ;
26-
2723 var builder = Host . CreateApplicationBuilder ( Environment . GetCommandLineArgs ( ) ) ;
2824
2925 // Configuration
@@ -42,22 +38,20 @@ public App()
4238 {
4339 client . BaseAddress = new ( builder . Configuration . GetRequired ( "ApiBase" ) ) ;
4440 } ) ;
45- _host = builder . Build ( ) ;
46- DefaultScope = _host ! . Services . CreateScope ( ) ;
41+ var host = builder . Build ( ) ;
42+ DefaultScope = host . Services . CreateScope ( ) ;
4743 }
4844
49- internal new static App Current => ( App ) Application . Current ! ;
45+ internal IServiceScope DefaultScope { get ; private set ; }
5046
51- internal IServiceScope ? DefaultScope { get ; private set ; }
47+ internal new static App Current => ( App ) Application . Current ! ;
5248
5349 public T GetService < T > ( )
5450 where T : class =>
55- DefaultScope ! . ServiceProvider . GetRequiredService < T > ( ) ;
51+ DefaultScope . ServiceProvider . GetRequiredService < T > ( ) ;
5652
57- public override void Initialize ( )
58- {
53+ public override void Initialize ( ) =>
5954 AvaloniaXamlLoader . Load ( this ) ;
60- }
6155
6256 public override void OnFrameworkInitializationCompleted ( )
6357 {
0 commit comments