Question

Is it possible to set the maxwidth of a control using VisualStateManager in xaml? I get following exception in blend when i try to set the maxwidth of a control:

ArgumentException: Invalid attribute value for property MaxWidth.

xaml is

<DoubleAnimation Duration="0" To="1000" Storyboard.TargetProperty="(FrameworkElement.MaxWidth)" Storyboard.TargetName="AbcControl" d:IsOptimized="True"/>
Was it helpful?

Solution

following xaml made it work.. although i had to write those line manually instead of blend generating them automatically

<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AbcControl" Storyboard.TargetProperty="(FrameworkElement.MaxWidth)"> <DiscreteObjectKeyFrame KeyTime="0" Value="1000" /> </ObjectAnimationUsingKeyFrames>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top