View Issue Details

IDProjectCategoryView StatusLast Update
0000816NoesisGUIUnitypublic2018-11-23 13:19
ReporterScherub Assigned Tosfernandez  
PrioritynormalSeverityminor 
Status resolvedResolutionopen 
Fixed in Version2.1.0f1 
Summary0000816: Animating "(TextElement.Foreground).(Brush.Opacity)" leads sometimes to unexpected results
Description

I've created a TextBox style that occasionally has some unexpected results due to the following line:

[code]
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(TextElement.Foreground).(Brush.Opacity)" To="0.5" />
[/code]

The results so far only apply to a ReadOnly textbox and reach from everything as expected over black font to non-visible font (but the text is there).

I've put the whole Style under "Additional Information".

PlatformAny

Activities

sfernandez

sfernandez

2016-02-02 13:06

manager   ~0003508

The behavior is unexpected as you are animating a DynamicResource brush that it is probably shared and animated in other places.

Anyway I tried this Style in Kaxaml and it complains about trying to animate an immutable object.

Besides inherited properties doesn't transfer its values beyond the ControlTemplate, so if you want to modify the Foreground property of a Control you should do it using a Setter that targets the control itself:


<ControlTemplate TargetType="TextBox">
...
<ControlTemplate.Triggers>
<Trigger Property="IsReadOnly" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ControlReadOnlyBrush}"/>
</Trigger>
<ControlTemplate.Triggers>
</ControlTemplate>

Scherub

Scherub

2016-02-02 13:55

reporter   ~0003509

Ah, of course. I forgot that it was a shared resource. I had the same problem with the border and background too until I instantiated a new SolidColorBrush from a color.

I'll try to change it, thanks! :)

jsantos

jsantos

2016-02-02 15:04

manager   ~0003510

Anyway, Sergio, shouldn't we be giving the same error as KaXaml/WPF?

sfernandez

sfernandez

2016-02-02 18:02

manager   ~0003513

Yes, this is something we have to fix.

Issue History

Date Modified Username Field Change
2016-02-01 22:39 Scherub New Issue
2016-02-02 13:06 sfernandez Note Added: 0003508
2016-02-02 13:06 sfernandez Assigned To => sfernandez
2016-02-02 13:06 sfernandez Status new => feedback
2016-02-02 13:55 Scherub Note Added: 0003509
2016-02-02 13:55 Scherub Status feedback => assigned
2016-02-02 15:04 jsantos Note Added: 0003510
2016-02-02 18:02 sfernandez Note Added: 0003513
2018-11-01 02:14 jsantos View Status public => private
2018-11-21 13:28 sfernandez View Status private => public
2018-11-21 13:28 sfernandez Additional Information Updated
2018-11-21 13:28 sfernandez Platform => Any
2018-11-21 13:31 sfernandez Additional Information Updated
2018-11-21 13:33 jsantos Target Version => 2.2.0
2018-11-23 13:19 sfernandez Status assigned => resolved
2018-11-23 13:19 sfernandez Fixed in Version => 2.1.0f1
2018-11-23 13:19 sfernandez Target Version 2.2.0 =>
2025-10-10 13:29 jsantos Category Unity3D => Unity