I am completely new developer at Windows Phone 7. I have TextBlock Text="{Binding MyDate} on MainPage.xaml page.
How can I change color of this TextBlock from MainPage.xaml.cs?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Firstly, you need to give the
TextBlockelement anx:Nameattribute, e.g.x:Name="myTextBlock". Once you’ve done this, the TextBlock is available in the code-behind as a field with the same name as what you put in thex:Name.To set the foreground color of a TextBlock, you can use something like