How can I create a Custom Control to be used in WinUI 3?
It must respond to mouse events (click, hoovering, dragging, double click)
Drawing with GDI commands (not User Control)
You can create a user control, which can handle mouse events, and instead of using GDI commands you can use Win2d in it.
For example:
<UserControl
xmlns:win2d="using:Microsoft.Graphics.Canvas.UI.Xaml" ...>
<win2d:CanvasControl Draw="CanvasControl_Draw" />
</UserControl>
private void CanvasControl_Draw(CanvasControl sender, CanvasDrawEventArgs args)
{
args.DrawingSession.DrawText("Hi!", 300, 300, Colors.SkyBlue);
}