Have (finally) created a baseball diamond control using xaml. (code below). I now need the ability to create "clickable" text at the major positions (1B, 2B, SS, 3B, etc). The text also needs to be rotated (since I draw this entire control in the corner and then rotate it at the end.
Can someone assist in adding text to my DrawingGroup? (bouns if it's clickable).
Any other comments appreciated, I'm brand new to Wpf, so I don't even know if I'm doing this correctly. My first attempt drew the diamond in code, but I wanted to challenge myself to completely defining it in XAML.
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="528.303" Width="582.133">
<Grid Background="#C0E49C">
<Image HorizontalAlignment="Stretch" VerticalAlignment="bottom">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Transform>
<TransformGroup>
<RotateTransform CenterX="0" CenterY="0" Angle="-135" />
<TranslateTransform X="0" Y="-4" />
</TransformGroup>
</DrawingGroup.Transform>
<GeometryDrawing Brush="#FFC080" >
<GeometryDrawing.Pen>
<Pen Brush="Black" Thickness="1"/>
</GeometryDrawing.Pen>
<GeometryDrawing.Geometry>
<GeometryGroup>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure StartPoint="0,0">
<PathFigure.Segments>
<PathSegmentCollection>
<LineSegment Point="500,0" />
<BezierSegment Point1="606,350"
Point2="350,606"
Point3="0,500"
/>
<LineSegment Point="0,0" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
<RectangleGeometry Rect="8,8,333,333" />
<EllipseGeometry Center="174.5,174.5" RadiusX="50" RadiusY="50" />
</GeometryGroup>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>