--- title: "How to: Create a Combined Geometry" ms.date: "03/30/2017" helpviewer_keywords: - "combining geometries [WPF]" - "graphics [WPF], combining geometries" - "geometries [WPF], combining" ms.assetid: 54c3277c-6b6e-4b25-91be-fda0bbc706b4 --- # How to: Create a Combined Geometry This example shows how to combine geometries. To combine two geometries, use a object. Set its and properties with the two geometries to combine, and set the property, which determines how the geometries will be combined together, to `Union`, `Intersect`, `Exclude`, or `Xor`. To create a composite geometry from two or more geometries, use a . ## Example In the following example, a is defined with a geometry combine mode of `Exclude`. Both and the are defined as circles of the same radius, but with centers offset by 50. [!code-xaml[GeometrySample#21](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometrySample/CS/combininggeometriesexample.xaml#21)] ![Results of the Exclude combine mode](./media/mil-task-combined-geometry-exclude.PNG "mil_task_combined_geometry_exclude") Combined Geometry Exclude In the following markup, a is defined with a combine mode of `Intersect`. Both and the are defined as circles of the same radius, but with centers offset by 50. [!code-xaml[GeometrySample#22](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometrySample/CS/combininggeometriesexample.xaml#22)] ![Results of the Intersect combine mode](./media/mil-task-combined-geometry-intersect.PNG "mil_task_combined_geometry_intersect") Combined Geometry Intersect In the following markup, a is defined with a combine mode of `Union`. Both and the are defined as circles of the same radius, but with centers offset by 50. [!code-xaml[GeometrySample#23](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometrySample/CS/combininggeometriesexample.xaml#23)] ![Results of the Union combine mode](./media/mil-task-combined-geometry-union.PNG "mil_task_combined_geometry_union") Combined Geometry Union In the following markup, a is defined with a combine mode of `Xor`. Both and the are defined as circles of the same radius, but with centers offset by 50. [!code-xaml[GeometrySample#24](~/samples/snippets/csharp/VS_Snippets_Wpf/GeometrySample/CS/combininggeometriesexample.xaml#24)] ![Results of the Xor combine mode](./media/mil-task-combined-geometry-xor.PNG "mil_task_combined_geometry_xor") Combined Geometry Xor