title: WPF Multiple CombinedGeometry
body: <p>I wish to bind a collection of viewmodels with X,Y,Radius properties to a CombinedGeometry of circles using Union. However it seems that CombinedGeometry only supports 2 Geometries.</p>
  
  <p>Is there anyway around this limitation?</p>
  
  <p>Example of what I'm aiming for</p>
  
  <pre><code>&lt;Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF"&gt;
    &lt;Path.Data&gt;
      &lt;CombinedGeometry GeometryCombineMode="Union" ItemsSource="{Binding Circles}"&gt;
        &lt;CombinedGeometry.Template&gt;
          &lt;EllipseGeometry RadiusX="{Binding Radius}" RadiusY="{Binding Radius}" CenterX="{Binding X}" CenterY="{Binding Y}"/&gt;
        &lt;/CombinedGeometry.Template&gt;
      &lt;/CombinedGeometry&gt;
    &lt;/Path.Data&gt;
  &lt;/Path&gt;
  </code></pre>
  
  <p>It is indeed possible to have CombinedGeometries within CombinedGeometry as seen below. However, I don't know how to set it up so that it is easily bindable.</p>
  
  <pre><code>   &lt;Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF"&gt;
          &lt;Path.Data&gt;
  
          &lt;!-- Combines two geometries using the union combine mode. --&gt;
          &lt;CombinedGeometry GeometryCombineMode="Union"&gt;
              &lt;CombinedGeometry.Geometry1&gt;
                  &lt;CombinedGeometry GeometryCombineMode="Union"&gt;
                      &lt;CombinedGeometry.Geometry1&gt;
                          &lt;EllipseGeometry RadiusX="50" RadiusY="50" Center="200,200" /&gt;
                      &lt;/CombinedGeometry.Geometry1&gt;
                      &lt;CombinedGeometry.Geometry2&gt;
                          &lt;EllipseGeometry RadiusX="50" RadiusY="50" Center="125,200" /&gt;
                      &lt;/CombinedGeometry.Geometry2&gt;
                  &lt;/CombinedGeometry&gt;
              &lt;/CombinedGeometry.Geometry1&gt;
              &lt;CombinedGeometry.Geometry2&gt;
                  &lt;CombinedGeometry GeometryCombineMode="Union"&gt;
                      &lt;CombinedGeometry.Geometry1&gt;
                          &lt;EllipseGeometry RadiusX="50" RadiusY="50" Center="100,100" /&gt;
                      &lt;/CombinedGeometry.Geometry1&gt;
                      &lt;CombinedGeometry.Geometry2&gt;
                          &lt;EllipseGeometry RadiusX="50" RadiusY="50" Center="150,120" /&gt;
                      &lt;/CombinedGeometry.Geometry2&gt;
                  &lt;/CombinedGeometry&gt;
              &lt;/CombinedGeometry.Geometry2&gt;
          &lt;/CombinedGeometry&gt;
      &lt;/Path.Data&gt;
  &lt;/Path&gt;
  </code></pre>