visualstates

VisualState in abstract control

被刻印的时光 ゝ 提交于 2019-12-05 21:23:23
I have an abstract BaseControl that contains dependency properties as well as default style and VisualState. I would like to use these VisualState in inherited Controls. I understand that setting the Template of the inherited control does not enable the VisualState to access the UIElement that it needs to update. How should I proceed to properly use these VisualStates? (copy paste the VisualState in the XAML of each inherited control is not an option for me). Is it possible to access the Template of a base control from an inherited control? Is there any in code solution? Any help is greatly

UWP VisualStateManager PointerOver does not work

冷暖自知 提交于 2019-12-04 05:34:39
问题 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 to work. Any ideas? I have implemented that programmatically but I want to use xaml to do that for practice. ---Update--- Changing Stackpanel to Grid still doesn't make things work. <GridView Grid.Row="1" Margin="10" IsItemClickEnabled="True" ItemsSource="{x:Bind Albums}"> <GridView.ItemTemplate>

Checked VisualState is not triggered after RadioButton is re-enabled

烈酒焚心 提交于 2019-12-02 15:42:43
问题 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 RadioButtons are disabled, and then re-enabled. When this happens the VisualState for the Checked RadioButton doesn't activate. Instead, all 5 RadioButtons appear as the Normal state. Why is this happening? How can I resolve this? Here is the example of the RadioButtons that I'm using. If I start by

UWP VisualStateManager PointerOver does not work

血红的双手。 提交于 2019-12-02 09:06:21
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 to work. Any ideas? I have implemented that programmatically but I want to use xaml to do that for practice. ---Update--- Changing Stackpanel to Grid still doesn't make things work. <GridView Grid.Row="1" Margin="10" IsItemClickEnabled="True" ItemsSource="{x:Bind Albums}"> <GridView.ItemTemplate> <DataTemplate x:DataType="data:GridAlbumView"> <Grid Width="180" Height="240" Margin="10"> <Grid

Checked VisualState is not triggered after RadioButton is re-enabled

杀马特。学长 韩版系。学妹 提交于 2019-12-02 08:21:06
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 RadioButtons are disabled, and then re-enabled. When this happens the VisualState for the Checked RadioButton doesn't activate. Instead, all 5 RadioButtons appear as the Normal state. Why is this happening? How can I resolve this? Here is the example of the RadioButtons that I'm using. If I start by selecting the first group of 5 RadioButtons , and make a selection, then everything may appear as the

Color Animation ContentPresenter

£可爱£侵袭症+ 提交于 2019-12-02 03:51:01
问题 I can't create an animation, or customize a color in ContentPresenter (NormalTextDay), this error appears in my XAML: 'System.Windows.Media.Animation.ColorAnimation' animation object can not be used to animate property 'Foreground' it is because of incompatible type 'System.Windows.Media.Brush <Style x:Key="CalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}"> <Setter Property="MinWidth" Value="5"/> <Setter Property="MinHeight" Value="5"/> <Setter Property="FontSize" Value="10"/>

How to change VisualState via ViewModel [duplicate]

泪湿孤枕 提交于 2019-11-29 02:39:37
This question already has an answer here: Binding [VisualStateManager] view state to a MVVM viewmodel? 4 answers I know this Question is similar to many. Anyway, I don't understand. I have a several VisualStates (more than 2, thats why DataStateBehavior is not my solution). And I have ViewModel, which have enum property CurrentState . Every enum value represents to one state, also may be several enum values represents to one states, doesn't metter. I want VisualState changed when the CurrentState changed (thought, that immediately appears in my mind : Binding was created exactly for this case!