Hi,
I encount an another problem with opacity gradient mask for a listbox, i want that it fade from the top and the bottom of that listbox. I create an opacity gradient to fill the listbox in kaxaml it work well the same in blend.
But in unity my listbox have lots of items and scroll ! My gradient opacity mack follow my scrolled content it is strange.
I give you my xaml
"in this version i try to fill a grid that containt the listbox.
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="640" d:DesignHeight="480" Width="640" Height="480">
<Grid.Resources>
<LinearGradientBrush x:Key="Brush1" EndPoint="284,410" StartPoint="28,-22">
<GradientStop Color="Black" Offset="0.809"/>
<GradientStop Offset="1"/>
<GradientStop Color="Black" Offset="0.157"/>
<GradientStop Color="#00000000" Offset="0"/>
</LinearGradientBrush>
<LinearGradientBrush x:Key="Brush2" EndPoint="0.5,38" MappingMode="Absolute" StartPoint="0,473">
<GradientStop Color="Black" Offset="0.528"/>
<GradientStop Offset="1"/>
<GradientStop Color="#18494949" Offset="0.704"/>
<GradientStop Color="#14000000" Offset="0.419"/>
<GradientStop/>
</LinearGradientBrush>
</Grid.Resources>
<Grid x:Name="LayoutRoot" Width="640" Height="480">
<Grid Margin="207,39,253,31" Width="180" Height="410" OpacityMask="{DynamicResource Brush2}" HorizontalAlignment="Left" VerticalAlignment="Top">
<ListBox Background="#FF8F8F8F" Foreground="#FFB9B9B9" IsSynchronizedWithCurrentItem="False" HorizontalAlignment="Left" VerticalAlignment="Top" Height="410" Width="180">
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
<Rectangle Fill="#FFF4F4F5" Stroke="Black" Width="150" Height="63"/>
</ListBox>
</Grid>
</Grid>
</Grid>
I should missing something
thanks