Questions tagged [visualstatemanager]

Manages visual states and the logic for transitions between visual states for controls. Also provides the attached property support for VisualStateManager.VisualStateGroups, which is how you define visual states in XAML for a control template.

Manages visual states and the logic for transitions between visual states for controls. Also provides the attached property support for VisualStateManager.VisualStateGroups, which is how you define visual states in XAML for a control template.

More detailed overview at MSDN

382 questions
5
votes
1 answer

VisualStateManager in Silverlight: setting an initial state

I often find the need to include "away" and "present" type visual states that are used to animate the control being away or visible depending on some other condition. The "away" state is then usually the one that should be the initial state. To my…
John
  • 6,693
  • 3
  • 51
  • 90
5
votes
2 answers

Set custom attached property on StoryBoard

I have a storyboard and would like to set the attached property VisualStateUtility.InitialState. I've tried various combinations, but the property never gets resolved. I get the following error: Cannot resolve TargetProperty…
Brian
  • 6,910
  • 8
  • 44
  • 82
5
votes
2 answers

How to add new Visual States to a Custom control template dynamically in code?

Is it possible to add a new VisualState to a CustomControl Template's VisualStateManager programmatically in code? For example, I can add to a CustomControl Template this XAML manually in design-time:
rem
  • 16,745
  • 37
  • 112
  • 180
5
votes
1 answer

WPF change visual state of datatemplate when selected in a listbox

If I have a WPF ListBox which has a basic ItemTemplate that contains a custom user control, how can I tell the user control in the DataTemplate to change its visual state when its selected in the ListBox? Thanks a lot for any help you can give
Mark
  • 14,820
  • 17
  • 99
  • 159
5
votes
1 answer

Using binding in VisualState Storyboard

I am writing a custom control for a WPF application. I want to use a color animation in a Storyboard in a VisualState definition. The To property of that animation should be bound to a dependency property of my control object. This does not appear…
NPVN
  • 95
  • 2
  • 8
5
votes
1 answer

How can I animate the visibility of a control in UWP using Visual States?

I'm currently working on a custom control for my application that expands and collapses content with a header which you can click to change states. The template for it looks like this at the moment.