Questions tagged [visualstates]

The tag has no usage guidance.

visualstates
Filter by
Sorted by
Tagged with
0 votes
2 answers
350 views

How to add an animation to a button when its command has executed in winui 3?

In a WinUi 3 application I created a custom Command that implements both an Executed event and a HasExecuted property with change notification. I want to design a CustomControl, preferably inheriting ...
Dabblernl's user avatar
  • 16k
1 vote
2 answers
282 views

ComboBox: How to show one property of Items when DropDown is open and a different one when DropDown is closed

In a WinUI 3 desktop app, I have a list of objects, each with a LongName and an Abbreviation property (both strings). I'd like to use a ComboBox to select a specific item. When the ComboBox dropdown ...
aturnbul's user avatar
  • 377
0 votes
1 answer
236 views

UWP - Button VisualState Focused is not working properly

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 ...
Laxmi's user avatar
  • 83
0 votes
3 answers
309 views

Is there a way to change Foreground of a TextBox ScrollViewer in xaml whithout change the local property?

Is there a way to change the Foreground of a custom TextBox in xaml with triggers or visualstates without change the local main Foreground property? Here is the xaml style of a generic custom TextBox ...
devpelux's user avatar
  • 2,492
-1 votes
1 answer
213 views

Binding not working on storyboard on custom control: values becomes null

I have created a custom control and I want to change the visualstate of this control immediately after the control is loaded. I want to use binding mode to get colors from dependency properties so i ...
devpelux's user avatar
  • 2,492
0 votes
1 answer
72 views

Visual state not firing when reducing window

I have 3 visual states , with adaptivetrigger. When windows is increasing they firing well. But if window is reducing from biggest state to smaller , setters not working and elements reset they style ...
Vladislav's user avatar
2 votes
1 answer
2k views

How to change the visual state of a control in Xamarin Forms?

I am trying to make a tabs like view with plain xamarin forms because I don't want to use any third party plugin. For that I used two frames like below and changed its state as "Selected" & "...
Ruvindra Yohan's user avatar
0 votes
1 answer
683 views

Manage a new visual state in buttons

I want to add a new "Activated" state to a WPF Button and I want to avoid re-creating a control from scratch. This new state is linked to the IsActivated dependency property and must change the ...
nkoniishvt's user avatar
  • 2,481
0 votes
1 answer
295 views

How to use window IsActive="False" state trigger in uwp?

In wpf it's looks like this: <DataTrigger Binding="{Binding IsActive, RelativeSource={RelativeSource AncestorType=Window}}" Value="false"> <Setter /> </DataTrigger>
Dmitry's user avatar
  • 609
0 votes
1 answer
423 views

UWP VisualStateManager PointerOver does not work

I am mimicking the behavior of Groove Music, which displays a drop shadow effect when mouse hovers on an album cover (in my code it's the entire DataTemplate). But My VisualStateManager doesn't seem ...
user avatar
0 votes
1 answer
81 views

Why does adding a border with corner radius to my button style wipe out the visualstate?

When I add a border with corner radius to my style, it makes the VisualState PointerOver and VisualState Pressed stop working. I tried inserting the border in several places where the IDE would allow ...
Nallware's user avatar
  • 159
0 votes
2 answers
87 views

How can I know which VisualState of control already defined in WPF's XAML?

How can I know which VisualState of control already defined in XAML? For example, WPF Button control has 2 VisualStateGroups by default. They are "CommonStates" and "FocusStates". The "CommonStates" ...
namhnz's user avatar
  • 75
3 votes
1 answer
259 views

uwp get notification for visual state changed in Custom Media Controls

in my uwp app I have Custom Media Transport Controls and I want to get notified whenever my controls appear and disappear from screen so I can match the cursor appear and disappear with it as well. ...
Muhammad Touseef's user avatar
3 votes
2 answers
311 views

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 ...
khamitimur's user avatar
  • 1,078
0 votes
1 answer
530 views

WPF X:Name causes type name 'ViewModel' Compile Error

I intend to set a state of CalibrationGridControl from a button. To do that, the CalibrationGridControl UserControl must have a x:Name (Blend even adds one for me when I setup the the GoToState ...
Johan's user avatar
  • 492
0 votes
2 answers
1k views

change label foreground color in visual state

I try to create my UserControl which have a Label and TextBox. I want to my control have custom set of Visual States. So I wrote this code in xaml: <UserControl x:Class="OgameApp.Components....
George Lemish's user avatar
3 votes
2 answers
84 views

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 ...
Gema Beltran's user avatar
0 votes
1 answer
95 views

Resizing wpf window, while recording state, distorts the wpf components

I want to record the state in blend for visual studio, but when i resize the window (Grid and Tab Control) for a state, the entire content will be distorted. If i am not recording then it will behave ...
Gaurav Raj Ghimire's user avatar
0 votes
0 answers
62 views

Using xaml states to change window size programatically

I have created 2 states for the main window of the program (big and small) and i have added a tabcontrol with 2 tab items. I want to use the big state to change the size of the window when i am in ...
Gaurav Raj Ghimire's user avatar
4 votes
1 answer
158 views

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.. <VisualState x:Name="MyVisualState"> &...
Gema Beltran's user avatar
0 votes
0 answers
27 views

Is there a way to make nested Visual States? Perhaps by inheriting from other visual states?

I'm making a nested/hierarchical menu using Visual States as my way of navigating. This works very nicely when going left to right in the menu. If I click Main Menu 3, it turns blue and the attached ...
Vlad's user avatar
  • 1,797
0 votes
1 answer
233 views

Keep PointerOver from changing text color of Checked button

I am having issue trying to have a set of radio buttons behave as buttons, and my goal is to have the text color of the buttons change on hover, and to have it go back to original color and be bolded ...
Gema Beltran's user avatar
5 votes
1 answer
2k views

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 ...
Gema Beltran's user avatar
0 votes
1 answer
400 views

UWP - Change Button VisualState dynamically

I am trying to change the button Pressed background dynamically. But I am unable to access to this property from the code behind. According to the base style of button, I tried to get the ...
Samuel LIOULT's user avatar
3 votes
1 answer
953 views

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....
Dominic Jonas's user avatar
0 votes
1 answer
2k views

UWP VisualState - Modifying entire class (Button for example)

in UWP, we can easily change the properties of a button for example based on the window size, using the visualstate.setters <VisualState x:Name="VisualStateNarrow" > <VisualState....
Franck E's user avatar
  • 691
0 votes
1 answer
914 views

Trigger a VisualState when the value of a bool property changes to true (and ignore when changes to false)

I'm working on a text editor whose UI will have two states: narrow and wide. Narrow is primarily intended to be used for window sizes below < 720px, and wide when above. However, in addition, if ...
Barrrdi's user avatar
  • 1,043
0 votes
1 answer
481 views

VisualStateManager does not revert to original state

The following definition is used as ItemContainer style for a GridView, SelectionMode "Single". When an element is selected, a particular glyph becomes visible to indicate selection. It works right ...
cyanide's user avatar
  • 3,945
0 votes
1 answer
131 views

How to set ScrollViewer Width bound to a page element ActualWidth in AdaptiveTrigger UWP

I have a ScrollViewer which Width property binds to another page element. I want to apply this only on certain AdaptiveTrigger MinWindowWidth <ScrollViewer x:Name="scrollViewerEditor" Width="{...
PutraKg's user avatar
  • 2,236
0 votes
1 answer
400 views

How to refresh style effects of 'Focused' VisualState of VisualStateManager?

I have the ListBoxItem's style as follows and a problem with loosing 'Focused' visual effects when the listBoxItem remains in mentioned VisualState. How to force appropriate visual effects to appear ...
spazi's user avatar
  • 53
0 votes
1 answer
423 views

How to change visual state from scroll viewer in wpf xaml

I'm pulling my hair out trying to get this to work. Im trying to learn to do transitions and struggling a bit. Basically im making a combo box, made up of a grid containing 2 rows. top row is a ...
Captain Awesome's user avatar
2 votes
0 answers
70 views

How to use same visual states over and over without having to copy and paste them each time in XAML

I am using the Mahapps.Metro framework and more specifically the transitionintcontentcontrol and the "Custom" transition. If I want to use the same custom transition, I have to create a collection of ...
Josh Menzel's user avatar
  • 2,349
2 votes
1 answer
1k views

heap corruption windows 10

In our Windows 10 UWP app we are suffering from Heap corruption during random page navigations. The timing and location is always different yet the same result is there, Heap corruption when Native ...
Mike Overwater's user avatar
1 vote
1 answer
136 views

VisualStateTrigger not updating

I'm making an Universal Windows application. I'm using a Splitview for my menu and if I resize my window I use visual state triggers to adjust the layout. But it doesn't seem to be working. I watched ...
justijn's user avatar
  • 139
0 votes
1 answer
744 views

VisualState commonState doesn´t work xaml

I have this XAML view. The VisualStateGroups for the visual triggers works fine, but the VisualStateGroup for the common states doesn't. I try assign to a rectangle in the beginning and then neither ...
Santiago's user avatar
  • 108
1 vote
1 answer
195 views

Using Staticresouce in Visual State causes Blend Designer to break: "Invalid attribute value Unknow for property Background"

I'm trying to change the Background of a Grid by using a Visual State and a Staticresouce as the value in the Setter of the Visual State. It works just fine at Runtime but the designer shows the ...
Cort3vl's user avatar
  • 163
0 votes
0 answers
804 views

Custom template for radio button and using Visual State

This is a custom style that i am using for a radio button.The concept is to flip the foreground and background color between checked and unchecked state. Everything works fine until i move mouse over ...
AGCodes's user avatar
  • 652
2 votes
1 answer
769 views

how change DataTemplate of ListView Item by VisualState in winrt?

I Try When Tap Edit TextBlock change the DataTemplate of listViewItem by VisualState but does not change for me my View <Page ................ DataContext="{Binding Categories, Source={...
Mohammad Tashani's user avatar
2 votes
1 answer
303 views

Changing WrapGrid's maximumRowsOrColums value by visualState triggers doesn't work

I'm making adaptive layout to my win 10 universal application. For some reason when I try to change wrapGrid's maximumRowsOrColumns value in visualState triggers, it doesn't work correctly. Well it ...
user3777939's user avatar
0 votes
1 answer
279 views

Detect when a ListBoxItem is in the SelectedUnfocused state

Problem I want my Listbox to UnselectAll() whenever the user clicks anywhere outside of it. What I've done so far The following code works fine for all clicks inside the application: private ...
pfw's user avatar
  • 237
2 votes
2 answers
461 views

Swapping brushes in VisualStateManager

I'm trying to create a custom style for a brush with a glass-type look. I have it looking the way I want it, but I can't get the Pressed behavior to work. The pressed look is simply the normal look ...
Ari Roth's user avatar
  • 5,462
2 votes
1 answer
3k views

DataTrigger with VisualStates in Windows phone 8.1

I'm trying to convert old Window phone 7.5 Silverlight Application to new WinRT Universal application and I have problems with this pice of code: <Style TargetType="Button"> <Setter ...
freshbm's user avatar
  • 5,564
0 votes
1 answer
549 views

How to hide XAML TextBlock with VisualStateManager?

I would like to hide a TextBlock based on the pages Visual State. I use the VisualStateManager to change states wich works fine. But my code for hiding the TextBlock somehow does not. Additional ...
user2988628's user avatar
2 votes
1 answer
148 views

GroupBox header background not updating when using Visual States

I have a group box that has custom styling on it and I'm trying to create Visual states for it and move to those visual states when a button is hit on my program. The code below stylizes the groupbox ...
Tbooty's user avatar
  • 279
1 vote
0 answers
175 views

Show multiple items selected within combobox in Silverlight when do key navigation in edit mode without dropdown open

Just bind ItemSource to Silverlight ComboBox. Do key navigation within a combobox where DropDown should not be opened. after completing key navigation click drop down icon to view the drop down list. ...
user3929088's user avatar
0 votes
5 answers
199 views

The only image for all button states for Android?

I have an image for my button. In order to make use of it I have to have 1 additional image for each state: 1. disabled 2. selected 3. pressed etc.. in iOS all those additional states are handled ...
Mando's user avatar
  • 11.6k
3 votes
1 answer
3k views

What is the proper way to implement VisualStates for multiple VisualStateGroups?

This question is a follow-up to my previous question as well as this related question about how VisualStates work in WPF. Currently, my understanding is that animating the same property within ...
Nicholas Miller's user avatar
1 vote
1 answer
2k views

Checked VisualState is not triggered after RadioButton is re-enabled

I'm working with a custom RadioButton control that is allows the user to give a rating between 1 and 5 depending on the selected RadioButton. However, there are times in my application that the 5 ...
Nicholas Miller's user avatar
0 votes
1 answer
110 views

VisualState not called

i have a custom togglebutton with some visual states. I have to override or change the "checked" state and do this in an easy way. But the state isn't shown but called. What i am doing wrong? Heres ...
JPOne's user avatar
  • 216
0 votes
1 answer
506 views

Transitioning "Visibility" in blend using visual states

So I have a loading control which if effectively a usercontrol that says "Loading" over the top of my main user control, preventing the user interacting with my program until it is loaded. I would ...
JKennedy's user avatar
  • 18.5k