TextBlock Color inside Button (with Blend 2015)
I have problem with states and Color for TextBlock.
I want change color and blend animation for TextBlock. I can easily set up everything in States. But when I run program from Blend, it crash, I get
I want change color and blend animation for TextBlock. I can easily set up everything in States. But when I run program from Blend, it crash, I get
I saw in Noesis Theme, there is ContentPresenter for text inside Button, but unfortunately can't change color for ContentPresenter inside Blend 2015 and I have to use TextBlock instead.An unhandled exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll Additional information: Cannot animate '(0).(1)' on an immutable object instance.
Re: TextBlock Color inside Button (with Blend 2015)
Ok, I found this solution: I must convert color (TextBlock) to LocalValue (for Base state) and then crash dissapear.
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: TextBlock Color inside Button (with Blend 2015)
That's it, marking this as solved.
About animating ContentPresenter color, it cannot be done directly using Blend visual tools, but it can be changed in xaml code by animating the attached property TextElement.Foreground.
About animating ContentPresenter color, it cannot be done directly using Blend visual tools, but it can be changed in xaml code by animating the attached property TextElement.Foreground.
Who is online
Users browsing this forum: No registered users and 6 guests