|
ProEssentials charting WinUI interfaces are used when creating stand-alone client-side EXEs to be distributed and ran on an end-users machine. WinUI 3 is our newest and most modern .NET interface, introduced in ProEssentials v11. It renders through Direct3D / Direct2D composition swap chains, targets .NET 10, and runs on both x64 and ARM64 hardware. This WinUI Charting Walk-through includes instructions for Visual Studio 2026 in C#.
It is recommended that the namespace: Gigasoft.ProEssentials.Enums be included at the top of your source code files. In C#, use the using keyword:
using Gigasoft.ProEssentials.Enums;
Before you start: WinUI 3 charting requires the .NET 10 SDK and the Visual Studio Windows application development workload (which supplies the Windows App SDK project templates). Our WinUI assembly is installed to ProEssentials11\DotNet10\x64 (also \AnyCpu and \Arm64).
| Important: WinUI 3 has no XAML Designer... |
Unlike our WinForms and WPF interfaces, you will not drag a ProEssentials chart out of the Toolbox. Visual Studio does not include a XAML Designer for WinUI 3 in any version, including VS2026. This is a Microsoft platform gap that affects every control vendor equally, so the WinUI Toolbox is empty by design and the Properties/Events window is not available at design time.
In practice this changes very little. You add our assembly as a reference (or a NuGet package), you hand-type one XAML tag, and you wire events in code. Microsoft's recommended replacement for the designer is the XAML runtime design tools: start the app with F5 (not Ctrl+F5) and use Hot Reload, Live Preview, Live Visual Tree and Live Property Explorer to adjust the running UI and see changes without restarting. Because a ProEssentials chart draws real data, the running app is a far more useful preview than a static designer surface ever was.
PRO TIP, a shorter path to a walkthough is starting with our WinUI starter repo which implements steps 1 and 2. Cloning this repo and starting with step 3 is recommended. However, understanding steps 1 and 2 is worth the read.
https://github.com/GigasoftInc/winui-starter
Walk-Through:
The following information demonstrates how to create your first .NET 10 WinUI 3 Charting ProEssentials implementation using the C# language. It discusses using the WinUI interfaces to add interactive charting content to your EXEs. Other examples are provided within the product/evaluation.
1) Start Visual Studio 2026 and create a new project targeting [C#] [Windows] [WinUI]. Visual Studio offers two WinUI app templates: WinUI Blank App (Packaged) and Blank App (Packaged with WAP Project). Choose the first (the simpler of the two) and accept the default name of [WinUIApp1].
| Lean up the template first (five defaults to change)... |
The stock WinUI template is aimed at a Microsoft Store MSIX app that ships the whole Windows App SDK. For a charting EXE, several of its defaults are wrong -- two of them prevent ProEssentials from working at all, and one silently adds about 41MB to your output. Make these changes now, before adding our assembly, and the rest of this walkthrough is uneventful.
| Template default |
Change it to |
Why |
net8.0-windows... |
net10.0-windows10.0.19041.0 |
Our WinUI assembly is .NET 10 only; our NuGet will not install otherwise. |
| (packaged -- no WindowsPackageType) |
<WindowsPackageType>None</WindowsPackageType> |
Lets the EXE run by double-clicking it, with no MSIX identity. |
Microsoft.WindowsAppSDK (umbrella) |
Microsoft.WindowsAppSDK.WinUI + Microsoft.WindowsAppSDK.Runtime |
Drops roughly 41MB of AI/ML runtime you never use. |
<PublishTrimmed>True</PublishTrimmed> |
False |
Trimming is not safe for WinUI XAML and can break the app at Release. |
x86;x64;ARM64 |
x64;ARM64 |
There is no x86 WinUI build of ProEssentials. |
a) Retarget to .NET 10. The Visual Studio 2026 WinUI templates still create a .NET 8 project. Our WinUI assembly is .NET 10 only, so our NuGet package will refuse to install into the template's default project. In the project file set...
|
<TargetFramework>net10.0-windows10.0.19041.0</TargetFramework>
|
If the target framework refuses to stick and snaps back to .NET 8, check <RuntimeIdentifiers> for legacy values. .NET 8 and later use a portable RID graph, and old OS-version RIDs such as win10-x64 are no longer valid; they block retargeting and fail the build with NETSDK1083. Use the portable form...
|
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
|
b) Switch to unpackaged. Both WinUI templates are packaged (MSIX) projects -- Microsoft does not ship an unpackaged WinUI template. A packaged app runs only with package identity, which Visual Studio supplies when you press F5. If you then browse to your bin folder and double-click the EXE directly, the app crashes on startup with...
|
System.Runtime.InteropServices.COMException (0x80040154): Class not registered (REGDB_E_CLASSNOTREG)
at WinRT.ActivationFactory.Get(String typeName)
at Microsoft.Windows.ApplicationModel.WindowsAppRuntime.DeploymentManagerCS.AutoInitialize...
|
This is expected Windows App SDK behavior, not a charting error: without package identity the Windows App Runtime's WinRT classes cannot be activated. To get an EXE that runs by double-clicking it -- the way our WinForms and WPF samples always have -- add this line to the <PropertyGroup> in your project file...
|
<WindowsPackageType>None</WindowsPackageType>
|
This makes the project unpackaged, which also switches it to the Windows App SDK bootstrapper (it will prompt to install the runtime if it is missing). Every ProEssentials WinUI sample we ship is unpackaged this way -- PewinUIDemo, GigaPrime2DwinUI, GigaPrime3DwinUI and the TestBeds Starter all set it. Keep the MSIX/packaged model only if you specifically intend to distribute through an MSIX package, and in that case launch from the Start menu rather than from bin.
Once the project is unpackaged, the template's MSIX scaffolding is dead weight. You may remove Package.appxmanifest and the Assets folder of Store tile logos, along with these project-file entries...
|
<EnableMsixTooling>true</EnableMsixTooling>
<ProjectCapability Include="Msix" /> <!-- and the ItemGroup holding it -->
<HasPackageAndPublishMenu>true</HasPackageAndPublishMenu> <!-- and its PropertyGroup -->
<Content Include="Assets\..." /> <!-- the Store logo entries -->
|
Keep app.manifest. It is not MSIX scaffolding -- it carries the DPI-awareness and supported-OS declarations, and our samples all keep it.
c) Use the Windows App SDK component packages, not the umbrella. The template references the all-in-one Microsoft.WindowsAppSDK package. That metapackage transitively pulls in the entire Windows AI/ML stack -- onnxruntime.dll (about 21MB) and DirectML.dll (about 18MB) plus the Microsoft.Windows.AI.* projections -- roughly 41MB of payload into the output folder of a chart application that never calls any of it. Replace the umbrella with the two component packages you actually need...
|
<!-- remove: <PackageReference Include="Microsoft.WindowsAppSDK" Version="2.2.0" /> -->
<PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="2.2.1" />
<PackageReference Include="Microsoft.WindowsAppSDK.Runtime" Version="2.2.0" />
|
Keep both: .WinUI supplies the XAML framework, and .Runtime supplies the framework dependency and the unpackaged bootstrapper. Our own NuGet packages already reference exactly these two, so if you install ProEssentials from NuGet you can simply delete the umbrella reference.
d) Turn off trimming. The template enables PublishTrimmed for every non-Debug build. Trimming is not safe for WinUI 3: the Microsoft.Windows.SDK.NET and WinRT.Runtime assemblies produce trim warnings, and XAML type resolution is reflection-driven, so a trimmed Release build can fail at run time even though Debug worked perfectly. This bites the first time you publish, long after the code is written.
|
<PublishTrimmed Condition="'$(Configuration)' != 'Debug'">False</PublishTrimmed>
|
e) Drop the x86 platform. The template offers x86, x64 and ARM64. ProEssentials WinUI ships x64, ARM64 and AnyCpu assemblies only -- there is no x86 WinUI build, and our AnyCpu assembly embeds the x64 and ARM64 native engines only. 32-bit development continues through our .NET 4.8 interfaces and PEGRP32I.DLL. Trim both lists...
|
<Platforms>x64;ARM64</Platforms>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
|
2) When the new project opens, you will be presented with "App.xaml / App.xaml.cs" and "MainWindow.xaml / MainWindow.xaml.cs". Opening MainWindow.xaml shows the XAML text editor only -- there is no split designer view (see the note above). XAML IntelliSense is fully available in the text editor.
| MainWindow.xaml [XAML]... |
Adding the ProEssentials reference... |
|
3) Adding the ProEssentials WinUI charting interface to your project
VS2026 Instructions -- two methods, either is fine
|
Method 1 -- Edit the Project File (Recommended). This is the simplest and clearest method, and it keeps our native engine visible in your project rather than hidden inside a package.
- 1. In Solution Explorer, double click the [WinUIApp1] project node to open WinUIApp1.csproj,
- 2. Copy Gigasoft.ProEssentialsWinUI.dll and Gigasoft.ProEssentialsWinUI.pri from "C:\ProEssentials11\DotNet10\x64" into your project folder,
- 3. Add the following ItemGroup to the project file...
|
<ItemGroup>
<Reference Include="Gigasoft.ProEssentialsWinUI">
<HintPath>.\Gigasoft.ProEssentialsWinUI.dll</HintPath>
</Reference>
</ItemGroup>
|
Note: the .pri file must sit beside the DLL. It carries our control templates (Generic.xaml) and is merged into your application's .pri at build time. Without it the chart will not render its template.
Note: the x64 assembly expects PEGRP64I.DLL to be distributed with your EXE. Use the \Arm64 assembly (with PEGRPARM64I.DLL) for ARM64 hardware, or the \AnyCpu assembly, which embeds both the x64 and ARM64 native engines inside the assembly and unpacks the correct one at run time.
Method 2 -- NuGet Package Manager.
- 1. Right click the project in Solution Explorer and select [Manage NuGet Packages...],
- 2. Change the Package Source to [Gigasoft (Local)]. Our setup adds this source pointing at "C:\ProEssentials11\NuGet",
- 3. Select ProEssentials.Chart.Net10.x64.WinUI and click [Install]. Use the .Arm64 or .AnyCpu package id to target other platforms,
- 4. The package brings in the correct native engine automatically.
- Note. Remember that no components will appear in the Toolbox -- that is expected for WinUI 3 and is not an installation failure.
|
| MainWindow.xaml [XAML]... |
Adding the WinUI chart to the window... |
|
|
4) Open MainWindow.xaml and hand-type the chart into your window. First add our XAML namespace to the <Window> tag, then place a chart tag between the <Grid> and </Grid> tags. Your MainWindow.xaml should look like...
|
<Window x:Class="WinUIApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:pe="using:Gigasoft.ProEssentials"
Title="WinUIApp1">
<Grid x:Name="RootGrid" UseLayoutRounding="True">
<pe:PegoWinUI x:Name="Pego1" />
</Grid>
</Window>
|
Note the type name. The WinUI control types carry a WinUI suffix: PegoWinUI, PesgoWinUI, Pe3doWinUI, PepcoWinUI and PepsoWinUI. All four of our .NET interfaces share the single namespace Gigasoft.ProEssentials and the identical PExxx property API, so only the type name changes between interfaces (WinForms Pego, WPF PegoWpf, WinUI PegoWinUI, WebForms PegoWeb).
* Note, use the Build menu, Rebuild project after adding the reference so the IDE compiles everything necessary for XAML IntelliSense to resolve the pe: prefix.
|
|
| MainWindow.xaml.cs [Code]... |
The chart Loaded event ... |
|