8,757
社区成员
发帖
与我相关
我的任务
分享
<TextBlock.Triggers>
<EventTrigger RoutedEvent="TextBlock.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="AnimatedTranslateTransform"
Storyboard.TargetProperty="X" Duration="0:0:25"
RepeatBehavior="Forever">
<DoubleAnimation.From>
<MultiBinding Converter="{StaticResource w2l}" ConverterParameter="-1">
<Binding Path="ActualWidth" ElementName="gdRoll"/>
<Binding Path="ActualWidth" ElementName="txtRoll"/>
</MultiBinding>
</DoubleAnimation.From>
<DoubleAnimation.To>
<MultiBinding Converter="{StaticResource w2l}" ConverterParameter="1">
<Binding Path="ActualWidth" ElementName="gdRoll"/>
<Binding Path="ActualWidth" ElementName="txtRoll"/>
</MultiBinding>
</DoubleAnimation.To>
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>class WidthToLocationConverter:IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
double x=(double)values[0] + (double)values[1];
x=x* System.Convert.ToDouble(parameter) /7.7;
return x;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}