How to put webview in a WPF project using Swift

This should workmen Water, too; you can add the package reference via “Add References” and selecting the “NuGet Packages” tab. You will want something in the XAML like:

<?xml version="1.0" encoding="utf-8"?>
<Window x:Class="WPFApplication3.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:web="clr-namespace:Microsoft.Toolkit.Wpf.UI.Controls"
    Title="Window1" Height="300" Width="300"
    >
    <Grid>
        <web:WebView />
    </Grid>
</Window>

Note that it seems the Microsoft.Toolkit.Wpf.UI.Controls.WebView package only support .NET 4.6.2 or later, so you’ll need to increase the Target Framework setting of the default project (with is 4.5). Or use .NET Core.