.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Interview Question >> WPF >> Post New Question Subscribe to Interview Questions

Why is Shape.Stroke a Brush rather than a Pen in WPF?

Posted By :Syed Shakeer Hussain     Posted Date :October 26, 2010    Points :10   Category :WPF 
Shape's Fill and Stroke properties have the same role as GeometryDrawing's Brush and Pen properties: Fill is for the inner area, and Stroke is for the outline. Internally, a Pen is indeed used to create the outline of the Shape. But rather than exposing the Pen directly, Shape defines Stroke as a Brush and exposes eight additional properties to tweak the settings of the internal Penwrapping the Stroke Brush: StrokeStartLineCap,StrokeEndLineCap, StrokeThickness, and so on.
This unfortunate inconsistency was created because setting the Pen-related properties directly on the Shape is simpler than using a separate Pen object, especially for the common case in which all you're setting is the Brush and the Thickness.

You can also find related Interview Question to Why is Shape.Stroke a Brush rather than a Pen in WPF?  below: 

Name the classes that derive from the abstract System.Windows.Shapes.Shape class in WPF?

1) Rectangle
2) Ellipse
3) Line
4) Polyline
5) Polygon
6) Path (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend