Reputation: 1076
i am learning to create custom control in XAML. I want correct symbol as shown below on one of my buttons
how can I get it using Path.Data/Geometry? is there any tool to generate this code.
Upvotes: 0
Views: 239
Reputation: 23290
Personally I prefer using Adobe Illustrator or Fireworks with the XAML export plugins available free online like Mike Swanson's http://www.mikeswanson.com/xamlexport/
Or if you're familiar with Expression Blend the pen tool would make short work of a path like that. Either give you pretty clean resulting xaml.
For now though to get you by, here's an example of your checkmark, but you might play with the color values to make it look exactly the same as I didn't spend but a minute making it.
<Path StrokeThickness="1.0" Stroke="#ff009344" StrokeMiterLimit="1.0" Data="F1 M 0.500,5.574 L 0.500,9.324 L 4.333,12.823 L 6.000,12.823 L 13.583,4.907 L 13.583,1.241 L 6.000,9.116 L 4.292,9.157 L 0.500,5.574 Z">
<Path.Fill>
<LinearGradientBrush MappingMode="Absolute" StartPoint="306.048,-391.325" EndPoint="307.800,-401.261">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0.00" Color="#ff8cc63e"/>
<GradientStop Offset="1.00" Color="#ff38b449"/>
</LinearGradientBrush.GradientStops>
<LinearGradientBrush.Transform>
<MatrixTransform Matrix="1.000,0.000,-0.000,-1.000,-299.500,-388.843" />
</LinearGradientBrush.Transform>
</LinearGradientBrush>
</Path.Fill>
</Path>
If you're going to be working with Paths and the design part of Controls often though, Expression Blend is the best for SL4/WPF but Blend 5 is still lacking some functionality. Hope this helps.
Upvotes: 1