Questions tagged [visualstates]
107 questions
5
votes
1 answer
Button VisualState Focused not working
I'm trying to change the font color of a button when the button is clicked. I have tried many different things but none have worked. This is the latest thing I tried and what I believe should be the answer but its not working. Can someone help?…

Gema Beltran
- 171
- 9
5
votes
1 answer
Why is the ColorAnimation for Checked state not persisting color after the MouseOver state is triggered?
I encountered an issue with a ControlTemplate for ToggleButton I created.
When the button is Checked, a ColorAnimation is triggered and the control's background changes color. However, if the user enters the MouseOver state, another animation is…

Ashley Grenon
- 9,305
- 4
- 41
- 54
4
votes
2 answers
How to change VisualState via ViewModel
I know this Question is similar to many. Anyway, I don't understand.
I have a several VisualStates (more than 2, thats why DataStateBehavior is not my solution). And I have ViewModel, which have enum property CurrentState. Every enum value…

stukselbax
- 5,855
- 3
- 32
- 54
4
votes
1 answer
Can I change the Canvas.Zindex of an object using visual states?
How could I change the Canvas.Zindex of an object using visual states? I was expecting to be able to do something like this..

Gema Beltran
- 171
- 9
4
votes
1 answer
How do I make a simple image-based button with visual states in Silverlight 3?
At my previous company, we created our RIAs using Flex with graphical assets created in Flash. In Flash, you could simply lay out your graphics for different states, i.e. rollover, disabled.
Now, I'm working on a Silverlight 3 project. I've been…

Jacob
- 77,566
- 24
- 149
- 228
4
votes
1 answer
How to animate Rectangle Stroke Thickness in XAML?
I have been trying to change the stroke thickness of my button, but I seem to be missing something. The basic idea is I want the button to look zoomed in, as I shrink the transparent stroke (border) around the rectangle.
Here are the variations that…

Alwyn
- 8,079
- 12
- 59
- 107
4
votes
1 answer
DataTrigger not firing when scrolling in ListView
We are having an issue with a pair of ListView controls in WPF, these controls are linked together to work as a single grid with a frozen column on the right hand side which contains a checkbox. This is so that the left hand section will be…

Spongeali
- 71
- 5
4
votes
1 answer
Keep Silverlight TextBox Selection Shows while not focused?
As titled, and basically I wanted to do the same thing as this for WPF but in Silverlight instead.
But in my TextBox.LostFocus event, there is no e.Handled. And I also tried to use VisualStateManger.GoToState to Focused State:
…

King Chan
- 4,212
- 10
- 46
- 78
3
votes
1 answer
Color Animation ContentPresenter
I can't create an animation, or customize a color in ContentPresenter (NormalTextDay), this error appears in my XAML:
'System.Windows.Media.Animation.ColorAnimation' animation object can not be used to animate property 'Foreground' it is because of…

J. Lennon
- 3,311
- 4
- 33
- 64
3
votes
3 answers
Accessing a style's storyboard of a button
My problem is that I have a Button and I want to access the Storyboard, which is a part of the assigned style.
3
votes
2 answers
Binding to ElementName depends on binding order
I created simple StateTrigger to bind to FrameworkElement Width property. There are three dependency properties: MinValue, MaxValue and Element. They types are double, double and FrameworkElement accordingly.
And I noticed that depending on binding…

khamitimur
- 1,078
- 13
- 22
3
votes
2 answers
Is it possible to have two style templates for one element and decide which one to use in code behind?
I have a button that has a style template in mode A. In mode A, this button has a PointerOver VisualState. I use the same button when I am in mode B, but in Mode B i'd like to have a different PointerOver VisualState.
What is the best way to get…

Gema Beltran
- 171
- 9
3
votes
1 answer
TemplateBinding in Storyboard | ObjectAnimationUsingKeyFrames not working
I have the following setup. the problem is, that if I switch to the VisualState "Alarm", the AlarmBrush is not set. I have tried different "Bindings" (see below), but I only get errors like System.Windows.Data Error: 2 : Cannot find governing…

Dominic Jonas
- 4,717
- 1
- 34
- 77
3
votes
0 answers
VisualState in abstract control
I have an abstract BaseControl that contains dependency properties as well as default style and VisualState.
I would like to use these VisualState in inherited Controls.
I understand that setting the Template of the inherited control does not enable…

user2465083
- 595
- 3
- 12