Custom WPF Controls

Generally, Silk4NET provides record and playback support for all standard WPF controls.

Silk4NET handles custom controls based on the way the custom control is implemented. You can implement custom controls by using the following approaches:
  • Deriving classes from UserControl

    This is a typical way to create compound controls. Silk4NET recognizes these user controls as WPFUserControl and provides full support for the contained controls.

  • Deriving classes from standard WPF controls, such as ListBox

    Silk4NET treats these controls as an instance of the standard WPF control that they derive from. Record, playback, and recognition of children may not work if the user control behavior differs significantly from its base class implementation.

  • Using standard controls that use templates to change their visual appearance

    Low-level replay might not work in certain cases. Switch to high-level playback mode in such cases.

Silk4NET filters out certain controls that are typically not relevant for functional testing. For example, controls that are used for layout purposes are not included. However, if a custom control derives from an excluded class, specify the name of the related WPF class to expose the filtered controls during recording and playback.