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
4
votes
1 answer

Can you animate ZIndex for TemplatedParent in VisualStateManager?

I have a custom control on which I'd like to add a mouse-over behavior to bring the object in its entirety to the top of the z-order then have it drop back into position when mouse is over a different object on the canvas. I have the following XAML,…
Jim O'Neil
  • 23,344
  • 7
  • 42
  • 67
4
votes
1 answer

How do I use VisualStateManager correctly?

my Code for changing properties does not work and I have absolutely no idea whats wrong, but maybe you do. Here is an simplified example of my Code, which reproduces the error. This is my Xaml-Code:
4
votes
1 answer

Difference between the MouseOver and PointerOver in VisualStateManager

I was wandering if someone could explain the difference between MouseOver and PointerOver? I am creating a custom ComboBoxItem Style, and using this link as a startpoint. After creating a playing around I discovered that the VisualState PointerOver…
Heinrich
  • 2,144
  • 3
  • 23
  • 39
4
votes
3 answers

How can I use VisualStateManager to change the text color (foreground) of a ListBoxItem?

Here's the deal. I can create a ListBox and style it. I can edit a copy of the template such that the States become available in Expression Blend 3. And I can change the state so that the background color of a line item is modified when selected.…
4
votes
1 answer

Changing properties of controls in ItemTemplate in VisualStateManager (WinRT XAML)

I have ListView that I am using for both my SnapView and Portrait view. However I'd like to change some items of my item template in both those views. The VisualStateManager seems like the ideal place to do this, but I can't figure it out. Here is…
Richard Garside
  • 87,839
  • 11
  • 80
  • 93
4
votes
2 answers

How to reuse Storyboard with VisualStateManager In Silverlight 5

This question has been asked before but in most cases no more recent than 2 years ago and often specific to WPF. The answer might still be there same, but here it goes. I'm trying to build a triangular (arrow) button that changes color and grows in…
xr280xr
  • 12,621
  • 7
  • 81
  • 125
3
votes
1 answer

WP7 controls: When to set VisualState after recovering from Tombstone?

My question is simple: WHEN (on what event?) can I be sure that a control has fully loaded and has its states and templates also? Why am I asking: I'm trying to restore the state of my own WP7 control after recovering from tombstone. This control…
Tenshiko
  • 1,450
  • 3
  • 17
  • 33
3
votes
2 answers
3
votes
2 answers

Silverlight: Can an event from one usercontrol begin an animation on a different usercontrol and/or the containing control

I have three UserControls in Silverlight. UCOutside contains two UserControls called UCInside1 and UCInside2. Containing UserControl
Bob Rhinehart
  • 175
  • 1
  • 1
  • 6
3
votes
1 answer

Page crash when insert VisualState.Setters Property for "Label.Text"

I have one .NET MAUI xaml-page with a Label and Switch. When i try to use VisualState-setters for change label text value on switch on/off, it work with emulator and in phone-debugger mode, but when i download it into my android phone the page crash…
jay mack
  • 39
  • 2
3
votes
2 answers

In XAML, What is the correct XML namespace for VisualStateManager?

I'm trying to restyle a few ToggleButtons. Apparently I cannot simply set the background to a new color, because there is a "Control Template" that provides the ToggleButton's visual behavior. So what I need to do is specify in XAML a replacement…
Cheeso
  • 189,189
  • 101
  • 473
  • 713
3
votes
2 answers

VisualStateManager fails to start animation on UserControl

I'm trying to start a animation on a UserControl using the VisualStateManager in a Windows Phone 7 Silverlight project but it won't work. GoToState just keep returning false. The code consists of a VisualState-behaviour which is running the…
Andreas Zita
  • 7,232
  • 6
  • 54
  • 115
3
votes
2 answers

Start a VisualState transition from XAML

In a user control (or whatever), we all know that the VisualStateManger can be used in code to start a transition, or animation, like so: if (target.IsLocked) { VisualStateManager.GoToState(this, "Locked", true); } else if…
A.R.
  • 15,405
  • 19
  • 77
  • 123
3
votes
2 answers

Silverlight: VisualStateManager.GetVisualStateGroups doesn't, How can I get them?

I've tried using VisualStateManager.GetVisualStateGroups in the OnAttached override of my custom behavior, as well as in an event handler added to AssociatedObject.Loaded event in that behavior. Both times I get an empty list. Is there another way…
3
votes
1 answer

Rider Xamarin xaml: "Field Normal is already declared" from VisualStateManager

I'm using Xamarin Forms 4.5.0.617 and want to use a VisualStateManager (https://learn.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual-state-manager) to change the style if an element is disabled. To apply this to all my styles, I…
meschi
  • 33
  • 5
1 2
3
25 26