Skip to content

Commit ea14794

Browse files
committed
[main] initialize project.
1 parent 7e45c7c commit ea14794

17 files changed

+448
-0
lines changed

Starter.sln

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,45 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
88
.editorconfig = .editorconfig
99
EndProjectSection
1010
EndProject
11+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main", "src\Main\Main.csproj", "{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}"
12+
EndProject
1113
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|ARM = Debug|ARM
16+
Debug|ARM64 = Debug|ARM64
17+
Debug|x64 = Debug|x64
18+
Debug|x86 = Debug|x86
19+
Release|ARM = Release|ARM
20+
Release|ARM64 = Release|ARM64
21+
Release|x64 = Release|x64
22+
Release|x86 = Release|x86
23+
EndGlobalSection
24+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|ARM.ActiveCfg = Debug|ARM
26+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|ARM.Build.0 = Debug|ARM
27+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|ARM.Deploy.0 = Debug|ARM
28+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|ARM64.ActiveCfg = Debug|ARM64
29+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|ARM64.Build.0 = Debug|ARM64
30+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|ARM64.Deploy.0 = Debug|ARM64
31+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|x64.ActiveCfg = Debug|x64
32+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|x64.Build.0 = Debug|x64
33+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|x64.Deploy.0 = Debug|x64
34+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|x86.ActiveCfg = Debug|x86
35+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|x86.Build.0 = Debug|x86
36+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Debug|x86.Deploy.0 = Debug|x86
37+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|ARM.ActiveCfg = Release|ARM
38+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|ARM.Build.0 = Release|ARM
39+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|ARM.Deploy.0 = Release|ARM
40+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|ARM64.ActiveCfg = Release|ARM64
41+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|ARM64.Build.0 = Release|ARM64
42+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|ARM64.Deploy.0 = Release|ARM64
43+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|x64.ActiveCfg = Release|x64
44+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|x64.Build.0 = Release|x64
45+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|x64.Deploy.0 = Release|x64
46+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|x86.ActiveCfg = Release|x86
47+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|x86.Build.0 = Release|x86
48+
{E6199770-0ED9-4E3B-A71A-90BDD8679E0E}.Release|x86.Deploy.0 = Release|x86
49+
EndGlobalSection
1250
GlobalSection(SolutionProperties) = preSolution
1351
HideSolutionNode = FALSE
1452
EndGlobalSection

src/Main/App.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<Application
2+
x:Class="Main.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" />

src/Main/App.xaml.cs

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
using System;
2+
using Windows.ApplicationModel;
3+
using Windows.ApplicationModel.Activation;
4+
using Windows.UI.Xaml;
5+
using Windows.UI.Xaml.Controls;
6+
using Windows.UI.Xaml.Navigation;
7+
using Main.Views;
8+
9+
namespace Main
10+
{
11+
/// <summary>
12+
/// Provides application-specific behavior to supplement the default Application class.
13+
/// </summary>
14+
public sealed partial class App
15+
{
16+
/// <summary>
17+
/// Initializes the singleton application object. This is the first line of authored code
18+
/// executed, and as such is the logical equivalent of main() or WinMain().
19+
/// </summary>
20+
public App()
21+
{
22+
InitializeComponent();
23+
Suspending += OnSuspending;
24+
}
25+
26+
/// <summary>
27+
/// Invoked when the application is launched normally by the end user. Other entry points
28+
/// will be used such as when the application is launched to open a specific file.
29+
/// </summary>
30+
/// <param name="e">Details about the launch request and process.</param>
31+
protected override void OnLaunched(LaunchActivatedEventArgs e)
32+
{
33+
var rootFrame = Window.Current.Content as Frame;
34+
35+
// Do not repeat app initialization when the Window already has content,
36+
// just ensure that the window is active
37+
if (rootFrame == null)
38+
{
39+
// Create a Frame to act as the navigation context and navigate to the first page
40+
rootFrame = new Frame();
41+
42+
rootFrame.NavigationFailed += OnNavigationFailed;
43+
44+
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
45+
{
46+
//TODO: Load state from previously suspended application
47+
}
48+
49+
// Place the frame in the current Window
50+
Window.Current.Content = rootFrame;
51+
}
52+
53+
if (e.PrelaunchActivated == false)
54+
{
55+
if (rootFrame.Content == null)
56+
{
57+
// When the navigation stack isn't restored navigate to the first page,
58+
// configuring the new page by passing required information as a navigation
59+
// parameter
60+
rootFrame.Navigate(typeof(MainPage), e.Arguments);
61+
}
62+
63+
// Ensure the current window is active
64+
Window.Current.Activate();
65+
}
66+
}
67+
68+
/// <summary>
69+
/// Invoked when Navigation to a certain page fails
70+
/// </summary>
71+
/// <param name="sender">The Frame which failed navigation</param>
72+
/// <param name="e">Details about the navigation failure</param>
73+
private void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
74+
{
75+
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
76+
}
77+
78+
/// <summary>
79+
/// Invoked when application execution is being suspended. Application state is saved
80+
/// without knowing whether the application will be terminated or resumed with the contents
81+
/// of memory still intact.
82+
/// </summary>
83+
/// <param name="sender">The source of the suspend request.</param>
84+
/// <param name="e">Details about the suspend request.</param>
85+
private void OnSuspending(object sender, SuspendingEventArgs e)
86+
{
87+
var deferral = e.SuspendingOperation.GetDeferral();
88+
//TODO: Save application state and stop any background activity
89+
deferral.Complete();
90+
}
91+
}
92+
}
1.4 KB
Loading
7.52 KB
Loading
2.87 KB
Loading
1.61 KB
Loading
1.23 KB
Loading

src/Main/Assets/StoreLogo.png

1.42 KB
Loading
3.13 KB
Loading

0 commit comments

Comments
 (0)