@@ -26,6 +26,7 @@ | |||||
<PackageReference Include="HandyControls" Version="3.4.1" /> | <PackageReference Include="HandyControls" Version="3.4.1" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | <PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" /> | ||||
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" /> | <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" /> | ||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.1343.22" /> | |||||
<PackageReference Include="Quartz" Version="3.4.0" /> | <PackageReference Include="Quartz" Version="3.4.0" /> | ||||
<PackageReference Include="Stylet" Version="1.3.6" /> | <PackageReference Include="Stylet" Version="1.3.6" /> | ||||
<PackageReference Include="SqlSugarCore" Version="5.1.2.7" /> | <PackageReference Include="SqlSugarCore" Version="5.1.2.7" /> | ||||
@@ -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 | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,21 @@ | |||||
<hc:Window | |||||
x:Class="HKCardOUT.Views.AdWindow" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:hc="https://handyorg.github.io/handycontrol" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:view2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" | |||||
xmlns:viewModels="clr-namespace:HKCardOUT.ViewModels" | |||||
Title="海科智慧一卡通平台" | |||||
d:DataContext="{d:DesignInstance Type=viewModels:AdWindowViewModel}" | |||||
ShowMaxButton="False" | |||||
ShowMinButton="False" | |||||
ShowTitle="True" | |||||
WindowStartupLocation="CenterScreen" | |||||
WindowState="Maximized" | |||||
mc:Ignorable="d"> | |||||
<Grid> | |||||
<view2:WebView2 x:Name="view2" /> | |||||
</Grid> | |||||
</hc:Window> |
@@ -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 | |||||
{ | |||||
/// <summary> | |||||
/// AdWindow.xaml 的交互逻辑 | |||||
/// </summary> | |||||
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("<html><body><div>hello world</div></body></html>"); | |||||
} | |||||
} | |||||
} |
@@ -11,6 +11,8 @@ namespace HKCardOUT.Views | |||||
public RootView() | public RootView() | ||||
{ | { | ||||
InitializeComponent(); | InitializeComponent(); | ||||
AdWindow ad = new AdWindow(); | |||||
ad.Show(); | |||||
if (Screen.AllScreens.Count() >= 2) | if (Screen.AllScreens.Count() >= 2) | ||||
{ | { | ||||
Dispatcher.Invoke(() => | Dispatcher.Invoke(() => | ||||