Have a look at the code. Try to guess
1. What color will be used to render text “Hello world” initially ?
2. Will it change after button click ?
Initially it will be yellow (yeah, it was easy). But after button click in WPF text color will change, but in SL for Windows Phone it won’t.
Explanation (actually not)
Basically i don’t understand this difference. I feel that this is a bug in Silverlight.
When we set foreground of a
1. ContentControl – the value gets inherited by TextBlockButton (TextBlockButton Foreground value is a new brush now), but notification is not sent to TextBlockButton template children (TextBlock) and TextBlock still uses old brush.
2. TextBlockButton – the notification is sent to its template children and text color changes.
Remove TemplateBinding for Foreground on TextBlock in ControlTemplate