Hi Fuse people,
I need your help.
This is the example I created for you:
<App>
<JavaScript>
let Observable = require("FuseJS/Observable");
let Pages = Observable();
let ActivePage = Observable(0);
let FirstPage = Observable(true);
let LastPage = Observable(false);
ActivePage.onValueChanged(module, newValue => {
FirstPage.value = newValue == 0;
});
ActivePage.onValueChanged(module, newValue => {
LastPage.value = newValue == 2;
});
function Page(Title) {
this.Title = Title;
}
function Next() {
ActivePage.value = ActivePage.value +1;
}
function Previous() {
ActivePage.value = ActivePage.value -1;
}
module.exports = {
ActivePage,
Next,
Previous,
FirstPage,
LastPage,
};
</JavaScript>
<Panel>
<ScrollView>
<Panel Margin="0,260,0,-260">
<DockPanel ux:Name="arrows" Alignment="Top" Height="60">
<WhileFalse Value="{FirstPage}">
<Panel Padding="24,0" Dock="Left" HitTestMode="LocalBoundsAndChildren">
<Text Value="back" FontSize="24" Alignment="VerticalCenter"/>
<Clicked Handler="{Previous}" />
</Panel>
</WhileFalse>
<WhileFalse Value="{LastPage}">
<Panel Padding="24,0" Dock="Right" HitTestMode="LocalBoundsAndChildren">
<Text Value="next" FontSize="24" Alignment="VerticalCenter"/>
<Clicked Handler="{Next}" />
</Panel>
</WhileFalse>
</DockPanel>
<PageControl ActiveIndex="{ActivePage}">
<Each Count="3">
<Page HitTestMode="LocalBoundsAndChildren">
<Panel ux:Name="title" Height="60" Color="White" Alignment="Top">
<Text Value="PAGE TITLE" TextAlignment="Center" Alignment="VerticalCenter" FontSize="24"/>
</Panel>
<StackPanel ux:Name="content" Margin="0,60,0,0" Color="White" ItemSpacing="20">
<Each Count="20">
<Rectangle Height="60" Color="Red" />
</Each>
</StackPanel>
<ScrollingAnimation From="260" To="260 + height(content)">
<Move Target="title" Y="1" RelativeTo="Size" RelativeNode="content" />
<Move Target="arrows" Y="1" RelativeTo="Size" RelativeNode="content" />
</ScrollingAnimation>
</Page>
</Each>
</PageControl>
</Panel>
</ScrollView>
<Panel Height="200" Color="Blue" Alignment="Top" Padding="24">
<Text Value="Content that goes behind when scrolling" TextColor="White" FontSize="40" TextWrapping="Wrap"/>
</Panel>
</Panel>
</App>
Here a screen capture of the example:
As you can see from the example, I’d like to scroll up the page and have the page title and button “next” stick to the top part of the screen. It all works perfectly, but as soon as I change page (by clicking on “next”), the button “next” and the button “back” behave in a weird way.
Here another screen capture with the final app:
As you can see I have the same exact issue here.
Thank you