This example uses the Vortice.Direct3D12 (https://github.com/amerkoleci/Vortice.Windows) library to draw primitives in a WinForms window.
Some code parts are taken from: https://github.com/amerkoleci/Vortice.Windows.Samples. Thank you.