Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Make Column Slide into position XAML
    primarykey
    data
    text
    <p>I have a wPF application. I have a column that has it's width set to zero at load time. It is bound to a property though &amp; when this value changes to a certain value the width changes to 2*. This all works fine.</p> <p>What I would like is to add an animation so it appears the column slides onto the grid. It is the column further most right so it would slide from the right of the screen to the left. Reading around it sounds like this is not easily done in just XAML?</p> <p><em><strong>EDIT</em></strong></p> <p>Here is what I have tried so far. The issue is "System.Windows.Media.Animation.DoubleAnimation' animation object cannot be used to animate property 'Width' because it is of incompatible type System.Windows.GridLength". Is there where a value converter comes into things?</p> <pre><code>&lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;ColumnDefinition&gt; &lt;ColumnDefinition.Style&gt; &lt;Style TargetType="{x:Type ColumnDefinition}"&gt; &lt;Setter Property="Width" Value="10"/&gt; &lt;Style.Triggers&gt; &lt;DataTrigger Binding="{Binding OrderSelected.Name}" Value="Mark"&gt; &lt;Setter Property="Width" Value="2*"/&gt; &lt;DataTrigger.EnterActions&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Storyboard.TargetProperty="Width" Duration="0:0:3" AutoReverse="True"/&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/DataTrigger.EnterActions&gt; &lt;/DataTrigger&gt; &lt;/Style.Triggers&gt; &lt;/Style&gt; &lt;/ColumnDefinition.Style&gt; &lt;/ColumnDefinition&gt; &lt;/Grid.ColumnDefinitions&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload