Sangeetha
Sangeetha

Reputation: 515

Control Template for Border

I would like to get a border of a particular shape, and for that, i think i need to work with the template of the border container, but i wasnt able to get the template. i tried to get the template from Expression Blend, by trying to edit the border style, but wasnt able to get it. Could someone help me out as to how i can get this template?

Upvotes: 5

Views: 12158

Answers (2)

Pavlo Glazkov
Pavlo Glazkov

Reputation: 20746

The Border doesn't have a control template or a style because it is a decorator - it renders itself in the OnRender method.

If you need something shaped differently you will need to write your own decorator (inherit from the Decorator class). It is not very difficult. See an example here: http://blog.pixelingene.com/2007/06/balloondecorator-source-code/

Upvotes: 6

user572559
user572559

Reputation:

Alternatively you can use a content control and place the stuff you need to be border'ed as its contents, that's a codeless way of doing things.

Upvotes: 6

Related Questions