From 69dbf7b5848a7e657b2911a9662e6dbd4f8f516b Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期四, 03 七月 2025 17:48:38 +0800 Subject: [PATCH] 可视化 --- 2025年6月12日/AuxAllWCS/Build/Project/界面/View1.xaml.cs | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" index 565e36f..3421993 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\347\225\214\351\235\242/View1.xaml.cs" @@ -50,13 +50,13 @@ this.DataContext = ViewModel.CreateInstance(this, typeof(View1)); this.Loaded += (this.DataContext as ViewModel).View1_LoadEvent; this.Closing += (this.DataContext as ViewModel).View1_CloseEvent; - commmd(); } public async void commmd() { await webView.EnsureCoreWebView2Async(); + labbb: if (!string.IsNullOrEmpty(HttpServer._listenerPrefix)) if (webView.Source != new Uri(HttpServer._listenerPrefix)) @@ -67,7 +67,22 @@ System.Threading.Thread.Sleep(2000); goto labbb; EndInit: - Console.WriteLine("end"); + Console.WriteLine("end Set Uri"); + webView.PreviewKeyDown += (object sender, KeyEventArgs e) => + { + // 妫�煡鎸変笅鐨勯敭鏄惁鏄�F12锛屽鏋滄槸锛岀姝㈠叾榛樿琛屼负 + if (e.Key == Key.F12) + { + e.Handled = true; + } + }; + await webView.CoreWebView2.ExecuteScriptAsync( + @" + document.addEventListener('contextmenu', function(event) { + event.preventDefault(); + }, false); + " + ); } } } -- Gitblit v1.9.1