How do you draw a line on a Canvas in .NET MAUI?

Lines can be drawn on an ICanvas using the DrawLine method, which requires four float arguments that represent the start and end points of a line.The following example shows how to draw a line: C#