WPF User Control Injection

John Peters - Feb 26 '21 - - Dev Community

Injecting small parts into a MainWindow is easy in WPF (once we know how).

Alt Text

We have to import the content of the folder first, in this case it's our 'usercontrols' folder which contains all our parts.

We give it a name of 'ucs' and the subsequent reference automatically present the user controls to select.

Result:
Alt Text

Here we see three tab items that came from our 'usercontrols' folder.

JWP2021 WPF UserControls

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player