Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 临时更改属性_C#_Wpf_Datatemplate - Fatal编程技术网

C# 临时更改属性

C# 临时更改属性,c#,wpf,datatemplate,C#,Wpf,Datatemplate,是否有可能通过数据模板实现一种行为,这样我就可以在“x”秒内更改单元格的前景色,然后将其恢复为原始颜色 例如,我定义了如下数据模板: <DataTemplate x:Key="ChangeTemplate"> <TextBlock Text="{Binding Converter={StaticResource percentConverter}, Path=ChangePercent}"

是否有可能通过数据模板实现一种行为,这样我就可以在“x”秒内更改单元格的前景色,然后将其恢复为原始颜色

例如,我定义了如下数据模板:

<DataTemplate x:Key="ChangeTemplate">
            <TextBlock Text="{Binding Converter={StaticResource percentConverter}, Path=ChangePercent}" 
                                     Foreground="{Binding Converter={StaticResource decimalToColorConverter}, Path=ChangePercent}" />
        </DataTemplate>
你能指导我如何实现这种行为,在“x”时间后,我将其改回原来的前景色吗

谢谢, SC

您可以尝试使用不使用的,因此属性在完成后将返回初始值。

您可以尝试使用不使用的,因此属性在完成后将返回初始值