If i have an element transformed outside the bounds of the WPF scrollviewer I can't seem to render it on top.
Consider the following example:
<Window x:Class="ScrollViewerContentTransform.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="Blue" Panel.ZIndex="1"/>
<ScrollViewer Grid.Row="1" Panel.ZIndex="2">
<Grid>
<Border Width="30" Height="30" Background="Red">
<Border.RenderTransform>
<TranslateTransform Y="-80"/>
</Border.RenderTransform>
</Border>
</Grid>
</ScrollViewer>
</Grid>
</Window>
Even when i set the zorder the red Border will still be hidden under the blue border.
If i replace the ScrollViewer with a Grid this will display as required. Any tips on how i can get the element to show on top when using the ScrollViewer?