1
czw
2025-07-03 9dcc6fbbb575b1d365208defe34290640d4be887
2025年6月12日/AuxAllWCS/Build/Project/界面/View1.xaml.cs
@@ -28,6 +28,8 @@
using GZ.DB.Repository.OIDATABASE;
using GZ.DB.IRepository.OIDATABASE;
using GZ.DB.Entity.OIDATABASE;
using Microsoft.Web.WebView2.Wpf;
using System.Threading;
namespace GZ.Projects.AuxAllWCS
{
@@ -50,6 +52,24 @@
            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))
                {
                    webView.CoreWebView2.Navigate(HttpServer._listenerPrefix + "/index.html");
                    goto EndInit;
                }
            System.Threading.Thread.Sleep(2000);
            goto labbb;
        EndInit:
            Console.WriteLine("end");
        }
    }
}