-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPage.h
More file actions
41 lines (31 loc) · 1.02 KB
/
MainPage.h
File metadata and controls
41 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include "MainPage.g.h"
#include "Internals/Internals.h"
namespace winrt::UWPWebView2::implementation
{
struct MainPage : MainPageT<MainPage>
{
MainPage();
const std::string& GetAppBaseUrl();
const std::string& GetWebResourceFolder();
WebView2& GetWebView2();
void SendWebMessage(const std::string& jsonStr);
private:
WebView2 webView = nullptr;
CoreWebView2 coreWV2 = nullptr;
WV2Internals internals;
void OnLoaded(const Windows::Foundation::IInspectable&, const Windows::UI::Xaml::RoutedEventArgs&);
fire_and_forget InitializeWebView();
void OnNavigationCompleted(const WebView2&, const CoreWebView2NavigationCompletedEventArgs&);
void OnWebMessageReceived(const WebView2&, const CoreWebView2WebMessageReceivedEventArgs&);
void HandleRuntimeInitMessage();
std::string appBaseUrl = "https://app.localhost/";
std::string webResourceFolder = "www";
};
}
namespace winrt::UWPWebView2::factory_implementation
{
struct MainPage : MainPageT<MainPage, implementation::MainPage>
{
};
}