Using the control requires that we add a new Namespace to our main window. Note that VB.NET offers you a menu of choices to make it easier to find the right one. In this case, the correct selection is ...
xmlns:local="clr-namespace:WPFUserControl"
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
In the current version of VB.NET, you might get a very misleading error at this point. The new namespace could have a squiggly line under it indicating there is a problem. If there is, hover the mouse over it and you will see a tooltip error message beginning, "Assembly WPFUserControl was not found." Why not? The message doesn't give a clue. VB.NET (currently) isn't quite smart enough to figure out that the User Control assembly simply hasn't been built yet. "Build" actually creates the assembly needed. Simply "Build" (from the VB.NET menu) the assembly and the error should go away.
Another point worth mentioning is that the name that is assigned to the namespace, in this case "local" is traditional but not required. You could give it any syntactically allowed name.
Add the new User Control to the main window code with a statement like this:
<local:avbfontviewer />
You can put this right inside the default Grid control that should already be in MainWindow.xaml if you like. This User Control can now be used anywhere you might need it in your project. The illustration below shows it in the default Grid control.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
You can use this technique to simply break up your XAML into more modular chunks if you wish. You might want to do this to let more than one programmer work on the same project code, or to simply get some completed code visually out of the way. When used this way, it doesn't fit the definition of User Control very well, but it can be a very useful technique.

