From 3e2d6db12314410f2251bd031d7bbcbf6531702c Mon Sep 17 00:00:00 2001 From: xxe Date: Fri, 9 Sep 2022 15:01:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B9=BF=E5=91=8A=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HKCardOUT/HKCardOUT.csproj | 1 + HKCardOUT/ViewModels/AdWindowViewModel.cs | 13 +++++++++ HKCardOUT/Views/AdWindow.xaml | 21 ++++++++++++++ HKCardOUT/Views/AdWindow.xaml.cs | 35 +++++++++++++++++++++++ HKCardOUT/Views/RootView.xaml.cs | 2 ++ 5 files changed, 72 insertions(+) create mode 100644 HKCardOUT/ViewModels/AdWindowViewModel.cs create mode 100644 HKCardOUT/Views/AdWindow.xaml create mode 100644 HKCardOUT/Views/AdWindow.xaml.cs diff --git a/HKCardOUT/HKCardOUT.csproj b/HKCardOUT/HKCardOUT.csproj index 2b95ada..2ac5b58 100644 --- a/HKCardOUT/HKCardOUT.csproj +++ b/HKCardOUT/HKCardOUT.csproj @@ -26,6 +26,7 @@ + diff --git a/HKCardOUT/ViewModels/AdWindowViewModel.cs b/HKCardOUT/ViewModels/AdWindowViewModel.cs new file mode 100644 index 0000000..1ac5de6 --- /dev/null +++ b/HKCardOUT/ViewModels/AdWindowViewModel.cs @@ -0,0 +1,13 @@ +using Stylet; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HKCardOUT.ViewModels +{ + public class AdWindowViewModel : PropertyChangedBase + { + } +} diff --git a/HKCardOUT/Views/AdWindow.xaml b/HKCardOUT/Views/AdWindow.xaml new file mode 100644 index 0000000..de5499e --- /dev/null +++ b/HKCardOUT/Views/AdWindow.xaml @@ -0,0 +1,21 @@ + + + + + diff --git a/HKCardOUT/Views/AdWindow.xaml.cs b/HKCardOUT/Views/AdWindow.xaml.cs new file mode 100644 index 0000000..81abd04 --- /dev/null +++ b/HKCardOUT/Views/AdWindow.xaml.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace HKCardOUT.Views +{ + /// + /// AdWindow.xaml 的交互逻辑 + /// + public partial class AdWindow : HandyControl.Controls.Window + { + public AdWindow() + { + InitializeComponent(); + InitView2(); + } + public async void InitView2() + { + await view2.EnsureCoreWebView2Async(null); + view2.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false; + view2.CoreWebView2.Settings.AreDevToolsEnabled = false; + view2.CoreWebView2.NavigateToString("
hello world
"); + } + } +} diff --git a/HKCardOUT/Views/RootView.xaml.cs b/HKCardOUT/Views/RootView.xaml.cs index eaf6e6d..44f97b7 100644 --- a/HKCardOUT/Views/RootView.xaml.cs +++ b/HKCardOUT/Views/RootView.xaml.cs @@ -11,6 +11,8 @@ namespace HKCardOUT.Views public RootView() { InitializeComponent(); + AdWindow ad = new AdWindow(); + ad.Show(); if (Screen.AllScreens.Count() >= 2) { Dispatcher.Invoke(() =>