Skip to content

Commit 98b1233

Browse files
author
rubgithub
committed
Add project files.
1 parent 818f4c3 commit 98b1233

17 files changed

+483
-0
lines changed

WebViewScriptNotify.sln

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebViewScriptNotify", "WebViewScriptNotify\WebViewScriptNotify.csproj", "{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM = Debug|ARM
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM = Release|ARM
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|ARM.ActiveCfg = Debug|ARM
19+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|ARM.Build.0 = Debug|ARM
20+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|ARM.Deploy.0 = Debug|ARM
21+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|x64.ActiveCfg = Debug|x64
22+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|x64.Build.0 = Debug|x64
23+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|x64.Deploy.0 = Debug|x64
24+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|x86.ActiveCfg = Debug|x86
25+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|x86.Build.0 = Debug|x86
26+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Debug|x86.Deploy.0 = Debug|x86
27+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|ARM.ActiveCfg = Release|ARM
28+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|ARM.Build.0 = Release|ARM
29+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|ARM.Deploy.0 = Release|ARM
30+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|x64.ActiveCfg = Release|x64
31+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|x64.Build.0 = Release|x64
32+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|x64.Deploy.0 = Release|x64
33+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|x86.ActiveCfg = Release|x86
34+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|x86.Build.0 = Release|x86
35+
{6CB17C0E-F6BC-4003-A35F-73FEF3B06FA5}.Release|x86.Deploy.0 = Release|x86
36+
EndGlobalSection
37+
GlobalSection(SolutionProperties) = preSolution
38+
HideSolutionNode = FALSE
39+
EndGlobalSection
40+
EndGlobal

WebViewScriptNotify/App.xaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Application
2+
x:Class="WebViewScriptNotify.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:WebViewScriptNotify"
6+
RequestedTheme="Light">
7+
8+
</Application>

WebViewScriptNotify/App.xaml.cs

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

0 commit comments

Comments
 (0)