How do I programmatically add pens to a trend window?

The following two (2) examples are for WinForm and WPF applications on how to add pens to a trend window during runtime programmatically.

WinForm:

WPF:

VB

C#