Hi! I have a Callback
inside a WhileVisibleInScrollView
but the trigger don’t call the MyFunction
in the first items! Only in the items behind.
I made an example. How can I solve this?! Thanks!
<App>
<JavaScript>
var Observable = require("FuseJS/Observable");
var Trigger = Observable("0");
function MyFunction() {
Trigger.value = parseInt(Trigger.value) + 1;
}
module.exports = {
Trigger: Trigger,
MyFunction: MyFunction
}
</JavaScript>
<DockPanel>
<ScrollView>
<StackPanel>
<Each Count="20">
<DockPanel ux:Name="theImage" Height="100" Margin="10">
<Translation X="1" RelativeTo="Size" />
<Rectangle Background="Red" />
<WhileVisibleInScrollView>
<Move Target="theImage" X="-1" RelativeTo="Size" Duration="0.5" />
<Change theImage.Visibility="Visible"/>
<Callback Handler="{MyFunction}" />
</WhileVisibleInScrollView>
</DockPanel>
</Each>
</StackPanel>
</ScrollView>
<Panel Dock="Bottom" Height="60" Background="Black">
<Text FontSize="20" Alignment="VerticalCenter" TextAlignment="Center" Value="{Trigger}" Color="White" TextWrapping="Wrap"/>
</Panel>
</DockPanel>
</App>