2010-01-07 8 views
4

를 사용하여 WPF에서 그리드 행의 높이를 변경하는 Grid 2 행 :는 어떻게이 스토리 보드

<Grid> 
    <Grid.RowDefinitions> 
     <RowDefinition Height="150"/> 
     <RowDefinition /> 
     <RowDefinition Height="Auto" x:Name="OtherContactsRow" /> 
    </Grid.RowDefinitions> 
    Something here 
</Grid> 

2 개 Storyboard의 :

<Storyboard x:Key="MaximizedStoryboard"> 
    <DoubleAnimation From="20" To="150" Duration="0:0:2" 
        Storyboard.TargetName="OtherContactsRow" 
        Storyboard.TargetProperty="Height" >  
    </DoubleAnimation> 
</Storyboard> 

<Storyboard x:Key="MinimizedStoryboard"> 
    <DoubleAnimation From="150" To="20" Duration="0:0:2" 
        Storyboard.TargetName="OtherContactsRow" 
        Storyboard.TargetProperty="Height"> 
    </DoubleAnimation> 
</Storyboard> 

내가 높이를 수정하려고

'System.Windows.Media.Animation.DoubleAnimation' animation object cannot be used to animate property 'Height' because it is of incompatible type 'System.Windows.GridLength'.

: OtherContactsRow 이름 행의 나는 다음과 같은 오류가 발생했습니다

모든 솔루션?

+0

답변은 여기 [http : //www.codeproject.com/KB/WPF/GridLengthAnimation.aspx]http://www.codeproject.com/KB/WPF/GridLengthAnimation.aspx] – Alin

답변

-2

ActualHeight 속성을 사용해보세요. double입니다.

+2

이제받습니다. 오류 : 'ActualHeight'Storyboard.TargetProperty 경로가 DependencyProperty를 가리 키지 않습니다. – Alin

관련 문제