views:

154

answers:

1

Hi,

I am creating a custom control by deriving TextBlock, my intention is to do some custom rendering based on some dependency properties. However the OnRender method is sealed on TextBlock. Although I can get my work done by overriding OnRenderSizeChanged, this is not correct. Any ideas on how can i do it the right way?

Thanks in advance.

A: 

In WPF you normally work with styles or Control templates to change the appearance of a control. You can download templates for all controls from Microsoft and play around with them.

Read more here:

http://msdn.microsoft.com/en-us/library/system.windows.controls.controltemplate(v=VS.100).aspx

Holli
I dont think control templates is going to help me.. My content is getting generated at runtime and i need to manipulate rendering of this runtime data.
Nitin Chaudhari