Good day, Hashcode.
I have a User Control
, with a picture in the background. Described as follows:
<Button some_parameters_here> <Button.Background> <ImageBrush ImageSource="wayToPicture.png" /> </Button.Background> </Button>
Now, when I change the value of the IsEnabled
property of the button, the background disappears when the value is false
, i.e. as if visibility changed. How can I make a color change instead, as in a normal control? (i.e., when IsEnabled = false
, the picture will become black and white)
As I understand it, you have to declare your class and inherit it from the control / button (what exactly?) And overload the IsEnabled
method. Honestly, I am not strong in inheritance, please help.
public class PaintedButton: Button // Control? { PaintedButton() :base() { } public override ??? { } }
PS So, I discovered the difference between WPF and Silverlight.