Hi guys, i’m struggling with building a horizontal scrollable page indicator, i dont get how can i specify a layoutMaster if my pages are observables and how can i make my horizontal scrollview scroll while i’m navigating.
<App>
<ClientPanel Color="#64b5f6">
<JavaScript>
var Observable = require("FuseJS/Observable");
var pages = Observable({"name":"page1", "title":"Annexes", "highlight":"#34495e"}, {"name":"page2", "title":"Travaux", "highlight":"#32595e"}, {"name":"page3", "title":"Rating", "highlight":"#37775f"}, {"name":"page4", "title":"CheckList", "highlight":"#34d6ee"}, {"name":"page5", "title":"CheckListBis", "highlight":"#34495e"}, {"name":"page6", "title":"CheckListBis", "highlight":"#39995e"}, {"name":"page7", "title":"CheckListBis", "highlight":"#34495e"})
module.exports = {
pages: pages,
pageCount: pages.length
}
</JavaScript>
<Page ux:Class="MyPage">
<ResourceFloat4 Key="Highlight" Value="{highlight}" />
<Rectangle Color="{highlight}" />
</Page>
<Grid Rows="1*,10*">
<Panel ux:Class="Tab" ClipToBounds="false" Margin="0,0,0,4">
<string ux:Property="Text" />
<Text Value="{ReadProperty Text}" Color="#FFF" Font="Bold" Alignment="Center" />
</Panel>
<!-- <Rectangle ux:Name="indicator" LayoutMaster="{ReadProperty }" Alignment="Bottom" Height="4" Color="#6c7a89">
<LayoutAnimation>
<Move RelativeTo="WorldPositionChange" X="1" Duration="0.4" Easing="BackIn"/>
</LayoutAnimation>
</Rectangle> -->
<Panel>
<ScrollView AllowedScrollDirections="Horizontal">
<StackPanel Orientation="Horizontal" Margin="30,0,0,0" ItemSpacing="40">
<Each Items="{pages}">
<Panel ux:Name="{name}">
<Tab Text="{name}"/>
</Panel>
</Each>
</StackPanel>
</ScrollView>
</Panel>
<PageControl ux:Name="pages">
<Each Items="{pages}">
<MyPage/>
</Each>
</PageControl>
</Grid>
</ClientPanel>
</App>