WpfHosting 0.3.2

dotnet add package WpfHosting --version 0.3.2
                    
NuGet\Install-Package WpfHosting -Version 0.3.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WpfHosting" Version="0.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WpfHosting" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="WpfHosting" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WpfHosting --version 0.3.2
                    
#r "nuget: WpfHosting, 0.3.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WpfHosting@0.3.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WpfHosting&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=WpfHosting&version=0.3.2
                    
Install as a Cake Tool

WpfHosting

Build(.NET) NuGet Azure Artifacts

日本語 (Japanese)

Library for building WPF applications using Generic Host.

説明

A library for building WPF applications using Generic Host (Host.CreateEmptyApplicationBuilder).

Installation

NuGet (Stable Release)

dotnet add package WpfHosting

Azure Artifacts (Development Builds)

dotnet add package WpfHosting -s https://pkgs.dev.azure.com/finphie/Main/_packaging/DotNet/nuget/v3/index.json

Usage

Create App.xaml and App.xaml.cs and write the following:

<Application x:Class="WpfHosting.Sample.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
</Application>
using System.Windows;

public sealed partial class App : Application
{
    public App() => InitializeComponent();
}

Create MainWindow.xaml and MainWindow.xaml.cs and write the following:

<Window x:Class="WpfHosting.Sample.Views.MainWindow"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="WpfHosting.Sample" Height="450" Width="800">
</Window>
using System.Windows;

public sealed partial class MainWindow : Window
{
    public MainWindow(MainWindowViewModel viewModel)
    {
        InitializeComponent();
        DataContext = viewModel;
    }
}

Create Program.cs and write the following:

using WpfHosting;

var builder = WpfApp.CreateBuilder<App, MainWindow>();
var app = builder.Build();
app.Run();

Sample Project

Supported Frameworks

  • .NET 9
  • .NET 8

Author

finphie

License

MIT

Credits

This project uses the following libraries, etc.

Analyzers

Others

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.2 286 5/3/2025
0.3.1 145 5/2/2025
0.3.0 155 5/2/2025
0.2.0 1,002 3/18/2023
0.1.0 533 3/15/2022