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
34
votes
5 answers

Binding [VisualStateManager] view state to a MVVM viewmodel?

How do you bind the VisualStateManager state of a control to a property in you viewmodel? Can it be done?
aL3891
  • 6,205
  • 3
  • 33
  • 37
17
votes
2 answers

How to debug VisualStateManager in runtime

There are very helpful tools out there to debug WPF applications in run-time like Snoop, WPF Inspector and Xaml Spy which allow you to sneak peek into running application and monitor property values, DataContext changes, routing events and even…
Sevenate
  • 6,221
  • 3
  • 49
  • 75
16
votes
3 answers

How to go back to "Base" state using VisualStateManager?

I know we can use VisualStateManager.GoToState(this,"SomeState1",true); to enter into SomeState1 , but now how to go back to the base state, like no state, the state where the control was loaded in. VisualStateManager.GoToState(this,"base",true);…
Akash Kava
  • 39,066
  • 20
  • 121
  • 167
12
votes
3 answers

How to wait for state changing transition to finish in Silverlight 4?

I need to change state of a control and then do some action. To be specific, I want to run an animation before a control is hidden. I would like to do something like that: VisualStateManager.GoToState(control, "Hidden", true); // wait until the…
gius
  • 9,289
  • 3
  • 33
  • 62
11
votes
1 answer

VisualStateManager and generated transitions

Just when I think I understand the VisualStateManager, something proves me wrong. I'm using WPF 4 and am trying to simply enlarge an item on mouse over, and shrink it back on mouse leave. I figured I'd just define each state in a VisualStateGroup…
10
votes
3 answers

In a button's control template, how can I set the color of contained text?

Using Silverlight 4 & WPF 4, I'm trying to create a button style that alters the text color of any contained text when the button is mouseover'd. Since I'm trying to make this compatible with both Silverlight & WPF, I'm using the visual state…
Jordan0Day
  • 1,386
  • 4
  • 15
  • 25
9
votes
3 answers

VisualStateManager -- showing mouseover state when control is focused

I am creating a WPF button using Windows 8 styling (formerly metro). I would like the focused state of the button to show with a solid background. When the mouse is over the control, I would like th background to darken slightly to create the…
Cameron Peters
  • 2,502
  • 2
  • 27
  • 34
8
votes
1 answer

Can I change the VisualState of a DataTemplate in a ItemTemplate?

I have some controls in a DataTemplate and I'd like to control it's pressed state behaviour. I did the following where I just put in VisualStateManager in the DataTemplate but it doesn't seem to work. I think it's possible to understand what I'm…
xster
  • 6,269
  • 9
  • 55
  • 60
7
votes
1 answer

Why does my AdaptiveTrigger fire when I change the theme settings?

I have a user interface that adapts to different device form factors using AdaptiveTrigger. In particular, I have a SplitView-based shell menu with two state triggers for when the minimum window width is 1000 epx and 600 epx respectively. The 600…
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
7
votes
1 answer

How to use VisualStateManager instead of DataTrigger to implement dynamic binding?

I've tried to implement DataTrigger, to perform dynamic binding based on which toggle button is toggled in a View. But after searching on the issue, DataTrigger in WinRT? it seems this is not available in Windows Universal apps, and…
Brian Var
  • 6,029
  • 25
  • 114
  • 212
7
votes
1 answer

WPF templating difference between triggers and visualStateManager

I would like to know what difference is between triggers and visualStateManager. I am templating ComboBox and on the official MSDN sites (http://msdn.microsoft.com/en-us/library/ms752094.aspx) they are using VisualStateManager for changing colors of…
tomdelahaba
  • 948
  • 3
  • 13
  • 26
7
votes
2 answers

How do I change the VisualState in WP7

I've defined the following two states in Expression Blend. I've been trying to follow this guide but I feel like it leaves me hanging when I need information on how and when to change state. According to the guide I am to attach a behaviour(I…
CodePrimate
  • 6,646
  • 13
  • 48
  • 86
6
votes
3 answers

VisualStateManager present both in WPF Toolkit and PresentationFramework - How to resolve

I have to use VisualStateManager class in my WPF window, but as I have referenced the assemblies of both WPF Toolkit and PresentationFramework.dll in my project, C# is not able to resolve the VisualStateManager class and gives the compile error like…
S2S2
  • 8,322
  • 5
  • 37
  • 65
6
votes
2 answers

wpf use VisualStateManager to change Visibility

I'm working on transitioning some code from silverlight to WPF, and my VisualStates are not working correctly. I am using visualstatemanager to control the visibility of some text fields. I am not using any transitions to animate the change, I just…
Shaboboo
  • 1,347
  • 1
  • 16
  • 35
6
votes
2 answers

Setting an Initial VisualState in WPF

When using the VisualStateManager in WPF there can be a requirement to transition to a VisualState on control initialization. As far as I can tell there is no way to declare an initial state in Xaml, leaving you with the limited option of…
Richard E
  • 4,819
  • 1
  • 19
  • 25
1
2 3
25 26