Tim Reinagel
Tim Reinagel

Reputation: 25

Why is VisualState.StateTriggers not recognized or is not accessible?

I am trying to change to BorderBrush of a Button based on an event.

I tried searching how to change visual states but all of the them use a combination of both VisualState.StateTriggers and VisualState.Setters. When I use them in my Style, I get error message "The member 'Setters' is not recognized or is not accessible".

Development Environment

Upvotes: 0

Views: 1100

Answers (2)

RareNCool
RareNCool

Reputation: 436

You mention that you're using Visual Studio 2013. However, according to Microsoft, you need at least Visual Studio 2015 to develop for UWP. My guess is that the "Universal" you selected is the old Windows 8.1-style "universal" which doesn't have the VisualState capabilities of UWP. You're not really working with a UWP project at all.

Upvotes: 2

Decade Moon
Decade Moon

Reputation: 34306

I created an empty project in Visual Studio, pasted in your XAML code into my main page and applied the style to a button. It compiles and runs fine.

Are you sure your project is a Universal Windows project and not something older (like Windows Runtime which does not have StateTriggers if I recall)? I'll need more information.

Upvotes: 0

Related Questions