1
- using Application = Microsoft . UI . Xaml . Application ;
1
+ using Application = Microsoft . UI . Xaml . Application ;
2
2
3
3
namespace SimpleCalculator ;
4
4
5
5
public class App : Application
6
6
{
7
- public static Window ? _window ;
7
+ public static Window ? _window ;
8
8
9
- protected override void OnLaunched ( LaunchActivatedEventArgs args )
10
- {
9
+ protected override void OnLaunched ( LaunchActivatedEventArgs args )
10
+ {
11
11
#if NET6_0_OR_GREATER && WINDOWS && ! HAS_UNO
12
12
_window = new Window ( ) ;
13
13
#else
14
- _window = Microsoft . UI . Xaml . Window . Current ;
14
+ _window = Microsoft . UI . Xaml . Window . Current ;
15
15
#endif
16
16
17
- // Do not repeat app initialization when the Window already has content,
18
- // just ensure that the window is active
19
- if ( _window . Content is not Frame rootFrame )
20
- {
21
- // Create a Frame to act as the navigation context and navigate to the first page
22
- rootFrame = new Frame ( ) ;
17
+ // Do not repeat app initialization when the Window already has content,
18
+ // just ensure that the window is active
19
+ if ( _window . Content is not Frame rootFrame )
20
+ {
21
+ // Create a Frame to act as the navigation context and navigate to the first page
22
+ rootFrame = new Frame ( ) ;
23
23
24
- // Place the frame in the current Window
25
- _window . Content = rootFrame ;
26
- }
24
+ // Place the frame in the current Window
25
+ _window . Content = rootFrame ;
26
+ }
27
27
28
- if ( rootFrame . Content == null )
29
- {
30
- // When the navigation stack isn't restored navigate to the first page,
31
- // configuring the new page by passing required information as a navigation
32
- // parameter
33
- rootFrame . Navigate ( typeof ( MainPage ) , args . Arguments ) ;
34
- }
28
+ if ( rootFrame . Content == null )
29
+ {
30
+ // When the navigation stack isn't restored navigate to the first page,
31
+ // configuring the new page by passing required information as a navigation
32
+ // parameter
33
+ rootFrame . Navigate ( typeof ( MainPage ) , args . Arguments ) ;
34
+ }
35
35
36
- // Ensure the current window is active
37
- _window . Activate ( ) ;
38
- }
39
- }
36
+ // Ensure the current window is active
37
+ _window . Activate ( ) ;
38
+ }
39
+ }
0 commit comments