<!-- Example 18-28. Markup and code behind for UserControl -->

<UserControl x:Class="CustomControlExample.CustomElement"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Grid>
    <Button Click="OnButtonClick" Content="_Click me" />
  </Grid>
</UserControl>

<!-- End of Example 18-28 -->