'Is there any risk using extremely high Zindex in WPF XAML?
I wonder if there is a risk of resource or performance when using super high ZIndex in a XAML view?
For exemple, is there a difference between this:
<Grid>
<Rectangle Name="BigBoss" Canvas.ZIndex="1000000"/>
<Rectangle Name="LitleBoss" Canvas.ZIndex="1000"/>
<Rectangle Name="normalGuy" Canvas.ZIndex="2"/>
</Grid>
and this:
<Grid>
<Rectangle Name="BigBoss" Canvas.ZIndex="2"/>
<Rectangle Name="LitleBoss" Canvas.ZIndex="1"/>
<Rectangle Name="normalGuy" Canvas.ZIndex="0"/>
</Grid>
I am not aware of the mechanic used behind ZIndex and how it is used to render the view but I assume that if there is a loop iterating every elements of the 1000000 "used" ZIndex, there would be clearly a performance issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
