title: Trying to have multiple content with user control
body: <p>Below is the xaml code I have for a custom user control.  My goal is to create a control which displays a graphic in the OuterBox, but then will also allow me to load another graphic to be displayed on top of it using the InnerBox section.  For example, the first/bottom/Outer graphic could be a picture of a dog.  If a user clicks this and answer is correct, a check mark graphic would appear on top of the dog.  If a wrong answer, a X would appear.  That is a very simplistic example, but illustrates the problem.  My program would have many permutations of outer and inner graphic combinations, so it is not feasible to have all possible combinations of outer and inner graphics options in a resource dictionary.</p>
  
  <p>I can see 2 options, with number 1 being preferable.</p>
  
  <ol>
  <li><p>Create control where you can set the outer and inner viewbox child content individually.  Right now, I can do one or the other, but not both.  Whichever content is set first is what appears.  Is it even possible?</p></li>
  <li><p>Generate xaml strings on the fly and piece the inner string within the outer string, thus creating a nested xaml string.  I have verified I can put a nested xaml string into a control from a resource dictionary and it will work.  To do this, how can I set the viewbox child content to a dynamically created xaml string through code, as will not be possible to store in dictionary ahead of time?  If this works, I could pull two xaml strings (outer and inner graphic), piece them together, and then display the nested graphic.</p></li>
  </ol>
  
  <p>I would like to do this in VB, but will work it out in C# if need be.</p>
  
  <p>Any help would be greatly appreciated. </p>
  
  <p>My control definition.</p>
  
  <pre><code>&lt;UserControl x:Class="CardBox"
                                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                   xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                   xmlns:local="clr-namespace:TestingNested"
                   mc:Ignorable="d" 
                   d:DesignHeight="300" d:DesignWidth="300"&gt;
  
  
        &lt;Viewbox Name="OuterBox"&gt;
          &lt;Canvas Width="100" Height="100"  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  
            &lt;!-- need outer content dynamically set here  --&gt;
  
  
            &lt;Viewbox Name="InnerBox"&gt;
              &lt;!-- need inner content dynamically set here  --&gt;
  
  
            &lt;/Viewbox&gt;
  
          &lt;/Canvas&gt;
        &lt;/Viewbox&gt;
  
  
      &lt;/UserControl&gt;
  </code></pre>