不透明度的基础值
Base value of Opacity
最近被下面一行代码弄糊涂了
<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CommonStatesWrapper"/>
根据我的理解,Opacity会立即从基础值变成0,因为Duration是0。但是不透明度的基础值是多少?
来自 MSDN 上的 UIElement.Opacity Property 页面:
Default opacity is 1.0. Expected values are between 0.0 and 1.0.
...
The 1.0 default value is the default provided by the initial metadata
of this dependency property on the UIElement class. Other derived
classes may potentially change this default value by overriding the
metadata from within their class constructor.)
最近被下面一行代码弄糊涂了
<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CommonStatesWrapper"/>
根据我的理解,Opacity会立即从基础值变成0,因为Duration是0。但是不透明度的基础值是多少?
来自 MSDN 上的 UIElement.Opacity Property 页面:
Default opacity is 1.0. Expected values are between 0.0 and 1.0.
...
The 1.0 default value is the default provided by the initial metadata of this dependency property on the UIElement class. Other derived classes may potentially change this default value by overriding the metadata from within their class constructor.)