I can’t set up the desired architecture of my app, which would consist in two (or more) series of pages. I mean:
I must be able to swipe between pages A1,A2,A3.
I must be able to swipe between pages B1,B2,B3.
But -swiping- between group A and group B should not be possible. Switching between the two groups must be possible only through a button in the bar.
I have read the documentation and tried lots of combinations nesting differents components, but couldn’t find a working layout. For example, if I set all the pages on the same level, how can I avoid swiping from page A3 to page B1? Or in alternative, how to set pages on two different, independant levels?
Thanks for any help Max
Thanks for you post and feedback. The kind of navigation you describe should be very easy to build with fuse. Have a look at the code I have put together, if I understood your issue correct this should be the architecture you want
<Grid ColumnCount="2" Dock="Top" Background="#0cf">
<NavigateTo Target="_a" NavigationContext="_mainNavigation" />
<NavigateTo Target="_b" NavigationContext="_mainNavigation" />
<LinearNavigation ux:Name="_mainNavigation" Easing="CubicInOut" />
<Text Alignment="Center" FontSize="30" />
<Move Y="-1" RelativeTo="Size" />
<Move Y="1" RelativeTo="Size" />
<Text Value="A1" />
<Text Value="A2" />
<Text Value="A3" />
<Text Value="B1" />
<Text Value="B2" />
<Text Value="B3" />
Let me know if this does not solve your issue
I really appreciate your response to my post, but unfortunately the code cannot compile due to this error:
Compiling syntax tree
C:\Users\User\Desktop\test 2\tab-bar-navigation.build\Simulator\Local17\Cache\GeneratedCode\TabBarNavigation.g.uno(1,8): E4009: Cannot use a sealed class as base class
Sorry about that I was using a slightly newer version than the current release. I have updated the code in my previous post!
Thanks for your patience
NavigationContext was the word…yes, great, it’s working as expected ! You got exactly what I needed and provided the right code!
Thanks a million…
a last thing… if the app logic needs, how to prevent swiping between pages A1 A2 A3 ?
A Fuse example uses this easy way to switch wiping off/on :
<WhileTrue ux:Name="canSwipe" Value="true">
<SwipeNavigate ux:Name="swipeNavigate" SwipeDirection="Left" SwipeEnds="Closed"/>
but in your code there is NO trace of SwipeNavigate…and swiping works…so how could I stop swiping ?
Ok I solved by myself, I just replaced one of the PageControl components with a Panel, and inside that Panel I can decide if swipe feature is available or not. When not available, I let user to change page only with buttons and only when the application logic allows it. As far as I have seen, swipe is enabled by default in a PageControl (don’t know how to stop it), while in a Panel it must be allowed by a SwipeNavigate tag. If this is not correct don’t hesitate to advise, it would be interesting also for other guys in the community !
Thanks a lot
Glad to see you figured it out What you did with Panel and SwipeNavigate is good, a PageControl is actually the same, we have added it for convenience when you want:
<Move X="-1" RelativeTo="ParentSize"/>
<Move X="1" RelativeTo="ParentSize" Duration="0.5"/>
<LinearNavigation ux:Name="TheNavigation" Easing="CircularOut" />
<SwipeNavigate SwipeDirection="Left" SwipeEnds="Closed"/>
So when you want more finegrained control like enabling/disabling swiping you have to build that with the UX elements needed