Disabling Button with custom Content in Silverlight?

Posted by andrej351 on Stack Overflow See other posts from Stack Overflow or by andrej351
Published on 2010-04-07T04:37:02Z Indexed on 2010/04/07 4:43 UTC
Read the original article Hit count: 526

Hi there,

What is the easiest way to create a Silverlight Button with custom Content which knows how to 'look' disabled? I.e. if you set IsEnabled="False" it will look greyed out.

The custom Content will be dead simple, text and an image.

I have done this before in a WPF application quite easily by setting the Content to a StackPanel containing a TextBlock and an Image. I then implemented a Style Trigger on the Image to change it to a greyed out version when it wasn't enabled. The text changed colour by itself.

As far as I can tell the custom Content disappears altogether when the button is disabled in Silverlight.

Any help is appreciated.

Cheers, Andrej.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about button