.net - 动画后的属性访问
问题描述
我有动画代码。
<TextBlock Grid.Row="1" VerticalAlignment="Top" FontSize="14"
Foreground="{Binding TextFill, Mode=OneWay}"
Text="{Binding Info, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
hlprs:AnimatableTextHelper.ProtectionProperty="{Binding ToogleButtonIsChecked, Mode=OneWay, NotifyOnTargetUpdated=True}" TargetUpdated="TextBlock_TargetUpdated"/>
TextBlock_TargetUpdated:
ColorAnimation animation = new ColorAnimation(Colors.Green, new Duration(TimeSpan.FromMilliseconds(1300)));
animation.Completed += (s, e_) =>
{
tmpSender.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, null);
var b = tmpSender.GetBindingExpression(TextBlock.ForegroundProperty);
};
animation.FillBehavior = FillBehavior.Stop;
tmpSender.Foreground.BeginAnimation(SolidColorBrush.ColorProperty, animation);
动画后我无法通过绑定和更新属性b == null
。我希望属性从 dataconttext 请求当前值
我究竟做错了什么?
解决方案
推荐阅读
- vb.net - vb.net参数启动窗体不隐藏?
- amazon-web-services - 如何引用 CloudFormationProvisionedProduct 输出
- python - 匹配两个数据框中的两列,如果它们匹配,则获取相应的列值
- ios - SWIFTUI:更改 ScreenSize 类后无法关闭工作表
- javascript - 正则表达式执行和测试行为不同
- kotlin - 用户在 Kotlin 中的 editText 上键入时如何调用 recyclerview
- mysql - 谁能告诉我如何解决这些错误?
- react-native - React Native - 使用 Facebook 登录 - 出现旧应用名称
- java - 如何使用 Spring MVC 在 JSP 页面中的 DataTable 中实现服务器端处理?
- css - 如何在 input[type] 上覆盖 CSS 类?