So here we are, a rectangle and a border with curved corners. Hmmm, what are the differences between them? Why different property names and API? Maybe I am too dumb to discover. Can someone please let me know?
I'm not sure if I'm going to tell you... Keep you guessing some more..?
Well, the difference is....
The Border is a Container Control, the Rectangle is a Path Geometry.
So say you want a nice rounded rectangle around your content. One way to do is is to have a Rectangle at a lower z-index and then overlay your content on top of it.
A better option is to have a border surround your element, and then just add what ever you want inside the Border control.
The difference is HUGE!
ReplyDeleteI'm not sure if I'm going to tell you... Keep you guessing some more..?
Well, the difference is....
The Border is a Container Control, the Rectangle is a Path Geometry.
So say you want a nice rounded rectangle around your content. One way to do is is to have a Rectangle at a lower z-index and then overlay your content on top of it.
A better option is to have a border surround your element, and then just add what ever you want inside the Border control.
:)
Oh I see! Didn't notice the Border is a container! (now you know how much coding I actually get chance to do normally...)
ReplyDeleteSo is it possible to have an irregular shaped element and add to a border control which will automatically draw around the irregular shape?
You can put anything inside a boarder, but it will always look like a rectangle.
ReplyDeleteIf you want a border around an irregular shape (a path), simply set the stroke thickness and stroke brush :)
that's true... By the way, can you do fancy colouring like gradient for stokes?
ReplyDeleteStroke is just a Brush, so you can put anything in it (solid color, gradients, pictures, tiles, or even videos)
ReplyDelete:)
And if i need the geometry of the Border, can i get it? how?
ReplyDeleteI need the geometry to check wether a border is intersecting a polygon in a canvas
3023
ReplyDelete