ameliore mon code wpf navigateur   using Microsoft.Web.WebView2.Core;
using System;
using System.Windows;

namespace NahouaNavigateur
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            webView.NavigationCompleted += WebView_NavigationCompleted;
            webView.CoreWebView2InitializationCompleted += WebView_CoreWebView2InitializationCompleted;

            // Charge le site Web dans le contrôle WebView2
            webView.Source = new Uri("http://aaconseils.ddns.net:8069/");
        }

        private async void WebView_CoreWebView2InitializationCompleted(object sender, CoreWebView2InitializationCompletedEventArgs e)
        {
            await webView.EnsureCoreWebView2Async();
        }

        private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCompletedEventArgs e)
        {
            // Code pour gérer la navigation
        }

        private void Refresh_Click(object sender, RoutedEventArgs e)
        {
            webView.Reload();
        }
    }
}
