visualstatemanager

Animation limited by panel

心不动则不痛 提交于 2019-12-11 03:01:48
问题 It's a little hard to describe but I'll try my best. I have a control which has an image and a label and it needs to have 2 states ("Big", and "Small"). On the "Big" state the image should be centered at the top of the control, and the label should be center below (Just like a dock with an image and a label docked to the top). On the "Small" state the image should be smaller and at the top left of the control, and the label should be right next to it. The big state should look like so: And

UWP XAML Change Style of a target with VisualStateManager

♀尐吖头ヾ 提交于 2019-12-11 01:33:05
问题 I´m using Style to custom my components: <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel.Resources> <Style TargetType="Button"> <Setter Property="Height" Value="80"/> <Setter Property="Width" Value="80"/> <Setter Property="Margin" Value="10"/> </Style> </StackPanel.Resources> <Button Content="Listas"/> <Button Content="Filas"/> <Button Content="Pilhas"/> <

VisualStateManager fails to start animation on UserControl

偶尔善良 提交于 2019-12-10 18:49:47
问题 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 GoToState when a State-property on the datacontext is changed, which happens when the button in the UI is clicked: What am I doing wrong? XAML: <Grid> <UserControl x:Name="_testSubject" l:VisualStates.CurrentState="{Binding State}" /> <Button

How to reuse Storyboard with VisualStateManager In Silverlight 5

隐身守侯 提交于 2019-12-10 17:26:21
问题 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 size when the mouse is over it. I've got that working for a single button. But now I need buttons with the arrow pointing different directions. I want to reuse as much of the code as possible. Without using a custom button control, I couldn't think

Gridview Item dynamic width according to Screen Size in UWP

此生再无相见时 提交于 2019-12-10 11:55:25
问题 I have created a GridView which gets data through data binding. What I want to do next is make the GridView item width dynamic according to the Screen Size ( Like the ones they have done in the Windows 10 news, sports app, etc. ) So far I have done it successfully for minimum window width 0 using visual state manager by setting the horizontal alignment to stretch, but I am not being able to continue this for other wider window sizes. Any kind of help for sorting this out will be appreciated.

Goto VisualState in Listivew item DateTemplate windows phone 8.1

百般思念 提交于 2019-12-10 11:15:22
问题 My requirement: when tapped on the border in ListViewItem(DataTemplate) an overlay should appear on top of it with animation. In my listview data template I defined a visual state at the root. I want to goto the visual state when user taps on the border. I have tried following xaml but it is not working <DataTemplate x:Key="MyTemplate"> <Grid Background="{Binding ItemBackground}" Margin="0,0,0,5" Height="auto"> <VisualStateManager.VisualStateGroups> <VisualStateGroup > <VisualState x:Name=

VisualState in abstract control

≡放荡痞女 提交于 2019-12-10 10:19:44
问题 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

VisualStateManager can't generate transitions for ThicknessAnimations

删除回忆录丶 提交于 2019-12-10 05:33:57
问题 I have the following Visual States defined: <VisualStateManager.VisualStateGroups> <VisualStateGroup Name="EditStates"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0:0:2"/> </VisualStateGroup.Transitions> <VisualState Name="Editing" /> <VisualState Name="Normal"> <Storyboard> <ThicknessAnimation Storyboard.TargetName="ViewBorder" Storyboard.TargetProperty="Margin" To="0" Duration="0"/> <DoubleAnimation Storyboard.TargetName="Header" Storyboard.TargetProperty="

Change VisualState based on property value

落花浮王杯 提交于 2019-12-07 07:05:32
问题 How to change a VisualState based on a property value on WP7? Im trying to use MVVM pattern and when my model is loading I want my view to go to especific VisualState. In Silverlight we have triggers for property changes but in WP7 not! PS: I dont want to use frameworks I want to understand how it is done in WP7. 回答1: I use the following attached behavior: using System; using System.Windows; using System.Windows.Controls; namespace PixelLab.WP7.Common.Behaviors { /// /// Provides an attached

Goto VisualState in Listivew item DateTemplate windows phone 8.1

一曲冷凌霜 提交于 2019-12-06 06:20:41
My requirement: when tapped on the border in ListViewItem(DataTemplate) an overlay should appear on top of it with animation. In my listview data template I defined a visual state at the root. I want to goto the visual state when user taps on the border. I have tried following xaml but it is not working <DataTemplate x:Key="MyTemplate"> <Grid Background="{Binding ItemBackground}" Margin="0,0,0,5" Height="auto"> <VisualStateManager.VisualStateGroups> <VisualStateGroup > <VisualState x:Name="OverlayState"> <Storyboard > <DoubleAnimation Storyboard.TargetName="checkedBorder" Storyboard