Gotorelative navigation issue

Hi guys,
i have to build two calendar on the same view (per month and per week) using page control.


but the problem is when i try to navigate to the next month on the calendar per month view , it sometimes push the page control navigation to the week view and try to reach the week calendar view navigation (there are separated) and give me an error.
https://youtu.be/258wsJbFPqY, when i quotes the week view the month calendar work well https://youtu.be/JxPICPg_Uqg
this is my code for the page who display both week and month view using page control.

  <PageControl ux:Name="MontsDate">
    <Page ux:Name="MO">
      <CalendarMonth ux:Name="monthDate" router="router"/>
      <ActivatingAnimation>
        <Change MoisRect.Opacity="1" Easing="Linear"/>
      </ActivatingAnimation>
    </Page>
    <Page ux:Name="Se">
      <CalendarWeek ux:Name="weekDate" router="router"/>
      <ActivatingAnimation>
        <Change SemaineRect.Opacity="1" Easing="Linear"/>
      </ActivatingAnimation>
    </Page>
  </PageControl>

this is the the month view

<DockPanel ux:Class="CalendarMonth">
  <Router ux:Dependency="router" />
  <JavaScript>
  var d = new Date()
  router.gotoRelative(calNav, "month", { month: d.getMonth(), year: d.getFullYear() } )
  </JavaScript>
  <Navigator ux:Name="calNav">
    <Mois ux:Template="month" router="router" SwipeBack="None"/>
  </Navigator>
</DockPanel>

this is the week view.

<DockPanel ux:Class="CalendarWeek">
  <Router ux:Dependency="router" />
  <JavaScript>
  var d = new Date()
  router.gotoRelative(WeekDispo, "semaine", {week: d})
  </JavaScript>
  <Navigator ux:Name="WeekDispo">
    <Semaine ux:Template="semaine" router="router" SwipeBack="None"/>
  </Navigator>
</DockPanel>

Hi prince,

I tried to give your code a go, but it’s clearly missing some significant parts and I can’t recreate the navigation flow you’re describing.

Would you mind stripping down your larger application and posting a complete reproduction we could take a look at?

The only thing that strikes me immediately is that you have imperative calls to router.gotoRelative. I think that these should instead be called from an <Activated> trigger, so you clearly know they only execute when the calendar/week view page is activated.

Hi Uldis thank you a lot for taking the time to help me.

Yes some part of my code is missing.

EDIT: because of large amounts of code, the project has been shared directly for debugging over other channels.

router.bookmark are activated only when i’m on that page , so router normally need to work only on that view.

So the problem appears to be rooted in the fact that the UX implementation of RouterModify differs from JS implementation of router.modify() in that, that the bookmarks used in the UX case can not be “relative” [for now].

Suggestion is to try and implement a different relative navigation using router.modify() instead.