├── wwwroot
├── src
│ ├── images
│ │ ├── StoreLogo.png
│ │ ├── SplashScreen.scale-200.png
│ │ ├── LockScreenLogo.scale-200.png
│ │ ├── Square44x44Logo.scale-200.png
│ │ ├── Wide310x150Logo.scale-200.png
│ │ ├── Square150x150Logo.scale-200.png
│ │ └── Square44x44Logo.targetsize-24_altform-unplated.png
│ ├── css
│ │ └── global.css
│ ├── index.html
│ └── js
│ │ └── activation.js
└── package.appxmanifest
├── SampleApp_JS
├── App.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── Default.rd.xml
├── Package.appxmanifest
└── SampleApp_JS.csproj
├── WebView.Interop
├── EventDispatcher.cs
├── Properties
│ ├── AssemblyInfo.cs
│ └── HybridWebApplication.rd.xml
├── ContactPanelActivatedEventArgs.cs
├── BackgroundActivatedEventArgs.cs
├── ContactPanel.cs
├── WebViewPage.cs
├── WebView.Interop.csproj
└── WebUIApplication.cs
├── WebView.Interop.UWP
├── Properties
│ ├── AssemblyInfo.cs
│ └── WebView.Interop.UWP.rd.xml
├── HybridWebApplication.cs
└── WebView.Interop.UWP.csproj
├── LICENSE
├── README.md
├── .gitignore
└── WebView.Interop.sln
/wwwroot/src/images/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/StoreLogo.png
--------------------------------------------------------------------------------
/wwwroot/src/images/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/wwwroot/src/images/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/wwwroot/src/images/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/wwwroot/src/images/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/wwwroot/src/images/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/wwwroot/src/css/global.css:
--------------------------------------------------------------------------------
1 | /* Element styles */
2 | body {
3 | margin: 0;
4 | font-family: 'Segoe UI';
5 | font-size: 10px;
6 | line-height: 14px;
7 | color: #323232;
8 | }
9 |
--------------------------------------------------------------------------------
/wwwroot/src/images/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shweaver-MSFT/WebView.Interop/HEAD/wwwroot/src/images/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/wwwroot/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Hybrid Web Application
8 |
9 |
10 |
11 |
12 |
13 | Hello World
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/SampleApp_JS/App.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using WebView.Interop.UWP;
3 |
4 | namespace SampleApp_JS
5 | {
6 | sealed partial class App : HybridWebApplication
7 | {
8 | // If building with web code local to the package, make sure to grant WebView access in the appxmanifest.
9 | //
10 | //
11 | //
12 | private static readonly Uri _appSource = new Uri("ms-appx-web:///index.html");
13 |
14 | static void Main(string[] args)
15 | {
16 | Start(_ => new App());
17 | }
18 |
19 | public App() : base(_appSource) { }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/WebView.Interop/EventDispatcher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Windows.UI.Core;
4 |
5 | namespace WebView.Interop
6 | {
7 | internal static class EventDispatcher
8 | {
9 | private static CoreDispatcher _dispatcher => CoreWindow.GetForCurrentThread()?.Dispatcher;
10 |
11 | public static async void Dispatch(Action action)
12 | {
13 | // already in UI thread:
14 | if (_dispatcher == null || _dispatcher.HasThreadAccess)
15 | {
16 | await Task.Run(action);
17 | }
18 | // not in UI thread, ensuring UI thread:
19 | else
20 | {
21 | await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => action());
22 | }
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/SampleApp_JS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("SampleApp_JS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("SampleApp_JS")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/WebView.Interop/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("HybridWebApplication")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("HybridWebApplication")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/WebView.Interop.UWP/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("WebView.Interop.UWP")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("WebView.Interop.UWP")]
13 | [assembly: AssemblyCopyright("Copyright © 2018")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Version information for an assembly consists of the following four values:
18 | //
19 | // Major Version
20 | // Minor Version
21 | // Build Number
22 | // Revision
23 | //
24 | // You can specify all the values or you can default the Build and Revision Numbers
25 | // by using the '*' as shown below:
26 | // [assembly: AssemblyVersion("1.0.*")]
27 | [assembly: AssemblyVersion("1.0.0.0")]
28 | [assembly: AssemblyFileVersion("1.0.0.0")]
29 | [assembly: ComVisible(false)]
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation. All rights reserved.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
22 |
--------------------------------------------------------------------------------
/WebView.Interop/ContactPanelActivatedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using Windows.ApplicationModel.Activation;
2 | using Windows.ApplicationModel.Contacts;
3 | using Windows.Foundation.Metadata;
4 |
5 | namespace WebView.Interop
6 | {
7 | [AllowForWeb]
8 | public sealed class ContactPanelActivatedEventArgs : IActivatedEventArgs
9 | {
10 | private Windows.ApplicationModel.Activation.ContactPanelActivatedEventArgs _contactPanelActivatedEventArgs;
11 |
12 | // IActivatedEventArgs members
13 | public ActivationKind Kind => _contactPanelActivatedEventArgs.Kind;
14 | public ApplicationExecutionState PreviousExecutionState => _contactPanelActivatedEventArgs.PreviousExecutionState;
15 | public SplashScreen SplashScreen => _contactPanelActivatedEventArgs.SplashScreen;
16 |
17 | // IContactPanelActivatedEventArgs members
18 | public Contact Contact => _contactPanelActivatedEventArgs.Contact;
19 | public ContactPanel ContactPanel { get; }
20 |
21 | public ContactPanelActivatedEventArgs(Windows.ApplicationModel.Activation.ContactPanelActivatedEventArgs contactPanelActivatedEventArgs)
22 | {
23 | _contactPanelActivatedEventArgs = contactPanelActivatedEventArgs;
24 | ContactPanel = new ContactPanel(contactPanelActivatedEventArgs.ContactPanel);
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SampleApp_JS/Properties/Default.rd.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/WebView.Interop/BackgroundActivatedEventArgs.cs:
--------------------------------------------------------------------------------
1 | using Windows.ApplicationModel.Activation;
2 | using Windows.ApplicationModel.Background;
3 |
4 | namespace WebView.Interop
5 | {
6 | ///
7 | /// For whatever reason, BackgroundActivatedEventArgs doesn't extend IActivatedEventArgs like
8 | /// all the other EventArgs classes in Windows.ApplicaitonModel.Activation.
9 | ///
10 | /// This class mushes activation args with the BackgroundActivatedEventArgs for use during app activation in JavaScript.
11 | ///
12 | public sealed class BackgroundActivatedEventArgs : IActivatedEventArgs, IBackgroundActivatedEventArgs
13 | {
14 | private IActivatedEventArgs _activatedEventArgs;
15 | private IBackgroundActivatedEventArgs _backgroundActivatedEventArgs;
16 |
17 | // IActivatedEventArgs members
18 | public ActivationKind Kind => _activatedEventArgs.Kind;
19 | public ApplicationExecutionState PreviousExecutionState => _activatedEventArgs.PreviousExecutionState;
20 | public SplashScreen SplashScreen => _activatedEventArgs.SplashScreen;
21 |
22 | // IBackgroundActivatedEventArgs members
23 | public IBackgroundTaskInstance TaskInstance => _backgroundActivatedEventArgs.TaskInstance;
24 |
25 | public BackgroundActivatedEventArgs(IActivatedEventArgs activatedEventArgs, IBackgroundActivatedEventArgs backgroundActivatedEventArgs)
26 | {
27 | _activatedEventArgs = activatedEventArgs;
28 | _backgroundActivatedEventArgs = backgroundActivatedEventArgs;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/WebView.Interop/ContactPanel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Windows.ApplicationModel.Contacts;
3 | using Windows.Foundation.Metadata;
4 | using Windows.UI;
5 |
6 | namespace WebView.Interop
7 | {
8 | [AllowForWeb]
9 | public sealed class ContactPanel
10 | {
11 | private Windows.ApplicationModel.Contacts.ContactPanel _contactPanel;
12 |
13 | public event EventHandler