From the course: Windows Presentation Foundation 5: Interaction and Controls
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Work with the line shape
From the course: Windows Presentation Foundation 5: Interaction and Controls
Work with the line shape
- [Instructor] The line class is one of the simplest shapes you can work with. I've got two lines drawn inside this page. I've got an orange line on the left side of the screen, and I've got this blue line, here. Here's how you draw one. Use the line class, and you specify some values. Now before I go too far, let's look at this top line which says fill equal red. The line is a shape class and at the shape class level, is a property called Fill. It doesn't make sense to have fill for a line, it just has a stroke but because it's inherited from the base classes here. You see I've set it to red but if you look over here in the designer, there's no red. It's ignored. That means I can remove this and it will have no impact. Next on line 14, I'm setting the stroke to orange setting the stroke thickness on line 15 and then I'm specifying the starting and ending points. I didn't specify the start point so it's using 0,0 as the starting point. So, that's here up in the upper left hand corner.…
Contents
-
-
-
-
-
-
-
Overview2m 50s
-
Use the Shape Stretch property3m 34s
-
Set the Fill and Stroke brushes6m 25s
-
Work with the line shape3m 33s
-
Work with Polyline and Polygon6m 45s
-
Use the StrokeDashArray and EndCap properties4m 52s
-
Create drawings with Path5m 49s
-
Use Blend for Visual Studio to draw a Path5m 24s
-
Hit testing with geometries4m 2s
-
-
-
-
-
-
-
-