|
|
От: |
MxKazan
|
|
| Дата: | 17.03.09 11:03 | ||
| Оценка: | 2 (1) | ||
Opacity is applied from parent elements on down the element tree to child elements, but the visible effects of the nested opacity settings aren't indicated in the property value of individual child elements. For instance, if a list has a 50% (0.5) opacity and one of its list items has its own opacity set to 20% (0.2), the net visible opacity for that list item will be rendered as if it were 10% (0.1), but the property value of the list item Opacity property would still be 0.2 when queried.
<Window x:Class="WpfApplication21.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="Transparent"
AllowsTransparency="True"
WindowStyle="None"
Title="Window1"
Height="300"
Width="300">
<StackPanel>
<Button Opacity="0.5">Opacity 0.5</Button>
<Button Opacity="1">Opacity 1</Button>
</StackPanel>
</Window>