Hey guys,
i have a little problem, maybe you can help me out.
I have a navigation bar at the bottom of my application which is managing the router navigation.
Navigation-Bar:
<Grid Columns="1*,1*,1*,1*" Height="45" Dock="Bottom" Padding="0, 1, 0, 0">
<Rectangle Layer="Background">
<Stroke Width="1" Color="#000000"/>
</Rectangle>
<Image ux:Class="Icon" Margin="5" />
<Panel Background="#ececec">
<Icon ux:Name="mapButton" Color="Gray" Width="40%" File="Assets/map.png" Clicked="{gotoMap}"/>
</Panel>
<Panel Background="#ececec">
<Icon ux:Name="poiButton" Color="Gray" Width="40%" File="Assets/poi.png" Clicked="{gotoPoi}"/>
</Panel>
<Panel Background="#ececec">
<Icon ux:Name="favoriteButton" Color="Gray" Width="40%" File="Assets/favorite.png" Clicked="{gotoFavorites}"/>
</Panel>
<Panel Background="#ececec">
<Icon ux:Name="infoButton" Color="Gray" Width="40%" File="Assets/info.png" Clicked="{gotoInformations}"/>
</Panel>
</Grid>
I used to change the color of the icons to display the currently active page:
<Router ux:Name="router" />
<Navigator DefaultTemplate="index" Transition="None">
<Page ux:Template="index">
<Index />
</Page>
<Page ux:Template="map">
<Map />
<WhileTrue Value="true">
<Change Target="mapButton.Color" Value="#332562" />
</WhileTrue>
</Page>
<Page ux:Template="poi">
<Poi />
<WhileTrue Value="true">
<Change Target="poiButton.Color" Value="#332562"/>
</WhileTrue>
</Page>
<Page ux:Template="favorites">
<Favorites />
<WhileTrue Value="true">
<Change Target="favoriteButton.Color" Value="#332562"/>
</WhileTrue>
</Page>
<Page ux:Template="informations">
<Informations />
<WhileTrue Value="true">
<Change Target="infoButton.Color" Value="#332562"/>
</WhileTrue>
</Page>
<Page ux:Template="DetailView">
<DetailView />
<WhileTrue Value="true">
<Change Target="poiButton.Color" Value="#332562"/>
</WhileTrue>
</Page>
</Navigator>
This was working perfectly.
Recently I changed my JS-Functions from router.goto
to router.push
(to get the OnBackButton working).
Now I am having problems to highlight the active page in my navigation bar.
The color changes to the Value but it is not changing back anymore.
Any ideas?
EDIT:
I am also not able to change the current page if I am on my first page (Map, which display a MapView in a NativeViewHost).