0
필자는 값 집합으로 움직이는 막 대형 차트를 사용합니다. 애니메이션 코드는WPF 키 프레임 바인딩
<UserControl.Resources>
<Storyboard x:Key="BootUp">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="MainBar">
<EasingDoubleKeyFrame KeyTime="0" Value="350"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="{Binding CurrentValue, ElementName=UserControl}"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
같은 외모와 C#
int ThisValue=200;
public int CurrentValue
{
get { return (int)ThisValue; }
set {
ThisValue=(int)value;
this.MainBar.ToolTip=value.ToString();
System.Windows.Media.Animation.Storyboard storyBoard = (System.Windows.Media.Animation.Storyboard)FindResource("BootUp");
storyBoard.Begin(this);
}
}
나는이 일을해야한다고 생각하지만, 때마다 그것은 무슨 일
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=UserControl'. BindingExpression:Path=CurrentValue; DataItem=null; target element is 'EasingDoubleKeyFrame' (HashCode=27594380); target property is 'Value' (type 'Double')
을 반환?
당신의 UserControl 이름의 UserControl이 있습니까 :이 ..with
:
이 교체
? –예, BarItem 및 막대 항목에 대한 참조로 변경하려고 시도했지만 여전히 작동하지 않습니다. – Bonzo