Call other pages from sidebar


How can I call OtherPage from Sidebar.ux?


<App Theme="Basic">
    <EdgeNavigator ux:Name="EdgeNavigator">
            var Observable = require("FuseJS/Observable");
            var currentPage = Observable("");

            var data = Observable();

            .then(function(response) { return response.json(); })
            .then(function(responseObject) { data.value = responseObject; });

            function showOtherPage() {
                currentPage.value = "OtherPage";
                debug_log("showOtherPage() > currentPage.value = " + currentPage.value);

            module.exports = {
                data: data,
                currentPage: currentPage,

                callPage: function () {

        <!-- Add a panel to the left edge -->
        <Sidebar Width="180" ux:Name="menu" EdgeNavigation.Edge="Left">
                <Change mainAppTranslation.X="180" />
                <!-- Change to cross out -->
                <Change topMenuTranslation.Y="0" />
                <Change bottomMenuTranslation.Y="0" />
                <Change middleRectangle.Opacity="0" Easing="CircularOut" />
                <Change topMenuRotation.Degrees="45" Easing="ExponentialIn" />
                <Change bottomMenuRotation.Degrees="-45" Easing="ExponentialIn" />
                <Change topRectangle.Width="28" />
                <Change bottomRectangle.Width="28" />

        <DockPanel Background="#fff">
            <!-- Use this to move the main app area with the side menu -->
            <Translation ux:Name="mainAppTranslation" />

            <StatusBarBackground Dock="Top" />
            <BottomFrameBackground Dock="Bottom" />

            <StackPanel Dock="Top">

                <!-- This is the top ledge -->
                <Grid ColumnData="auto,1*,auto"  Background="White">
                    <Panel Margin="7,5,5,5" Height="32" Width="32" HitTestMode="LocalBounds">
                            <Set EdgeNavigator.Active="menu" />
                        <Rectangle ux:Name="topRectangle" Height="2" Width="26" Fill="#000">
                            <Translation Y="-9" ux:Name="topMenuTranslation" />
                            <Rotation ux:Name="topMenuRotation" />
                        <Rectangle ux:Name="middleRectangle" Height="2" Width="26" Fill="#000" />
                        <Rectangle ux:Name="bottomRectangle" Height="2" Width="26" Fill="#000">
                            <Translation Y="9" ux:Name="bottomMenuTranslation" />
                            <Rotation ux:Name="bottomMenuRotation" />

                    <Text FontSize="22" Alignment="VerticalCenter" TextAlignment="Center"
                        Value="NEWS" Padding="2">
                        <Font File="assets/fonts/AlegreyaSans-Bold.otf" />

                    <Panel Margin="5,5,7,5" Height="32" Width="32" HitTestMode="LocalBounds">
                            <DebugAction Message="Search clicked" />
                        <Circle Height="20" Width="20">
                            <Stroke Width="2" Brush="#000" />
                        <Rectangle Width="7" Height="3" Fill="#000">
                            <Translation X="8" Y="8" />
                            <Rotation Degrees="45" />
                <Rectangle Height="1" Margin="0,5,0,0" Fill="#333c48" />

            <!-- This is the main scroll area -->
                <StackPanel Alignment="Top">
                    <Panel Height="7" />
                    <Each Items="{data.responseData}">
                        <NewsItem />

        <Page ux:Name="OtherPage" Name="OtherPage"> 
            <OtherPage NavigationController="{currentPage}"/>        </Page>




<StackPanel ux:Class="Sidebar" Background="#212831">
    <WhileInactive Threshold="0.4">
        <Move Target="user" X="-180" Duration="0.2" Delay="0.3" Easing="CircularIn" />
        <Move Target="stats" X="-180" Duration="0.2" Delay="0.2" Easing="CircularIn" />
        <Move Target="browser" X="-180" Duration="0.2" Delay="0.15" Easing="CircularIn" />
        <Move Target="feed" X="-180" Duration="0.2" Delay="0.1" Easing="CircularIn" />
        <Move Target="chat" X="-180" Duration="0.2" Delay="0.05" Easing="CircularIn" />

    <Text ux:Class="Username" TextAlignment="Center" FontSize="18" TextColor="#fff" Margin="0,8,0,0">
        <Font File="assets/fonts/AlegreyaSans-Bold.otf" />
    <Text ux:Class="Stats" TextAlignment="Center" FontSize="16" TextColor="#fed166" />
    <Text ux:Class="Relations" TextAlignment="Center" FontSize="11" TextColor="#414f5e" />
    <Text ux:Class="MenuLabel" TextAlignment="Center" FontSize="18" TextColor="#414f5e" Margin="0,0,0,0">
        <Font File="assets/fonts/Lato-Bold.ttf" />

    <StatusBarBackground Background="#909498" />

    <StackPanel ux:Name="user">
        <Panel Height="90" />
        <Circle Width="85" Height="85">
            <ImageFill Url="; />
        <Username>EDWARD PRICE</Username>

    <Grid ux:Name="stats" Alignment="HorizontalCenter" ColumnCount="3" Margin="0,10,0,15">
        <StackPanel Width="70">
        <Rectangle Height="40" Width="1">
            <SolidColor Color="#414f5e" />
        <StackPanel Width="70">

    <Image ux:Class="SidebarIcon" Height="22" Width="22" Margin="0,24,0,9" Color="#7a96b2" />

        <StackPanel ux:Name="browser">
            <SidebarIcon File="assets/icon/Browser.png" />
                <Callback Handler="{callPage}" />
        <StackPanel ux:Name="feed">
            <SidebarIcon File="assets/icon/Feed.png" />
        <StackPanel ux:Name="chat">
            <SidebarIcon File="assets/icon/Chat.png" />



<Page ux:Class="OtherPage" ux:Name="self">
    <string ux:Property="NavigationController"/>

    <Rectangle Layer="Background" Fill="#F3825F" />

    <StackPanel Alignment="VerticalCenter" Margin="50,0,50,0">
                <Callback Handler="{showMenuPage}" />
            <Fuse.BasicTheme.ButtonText Value="{currentPage}" TextAlignment="Center"/>


If you want to navigate from the main page to OtherPage then you need an additional navigator since the EdgeNavigator only handles the side menu.

Basically, what you need is a structure like this:

        <first page/>

With this setup the sidebar can be opened both when you are on the first page and when you are on OtherPage.

<first page/> in this example just means most of the things you have inside the DockPanel with Background="#fff".

To handle the navigation between first page and OtherPage you just work with the LinearNavigation as normal (using either NavigateTo or by data binding the Active property).

A separate note You should put the StatusBarBackground and BottomFrameBackground in the outmost panel. The way you have it set up now (inside the DockPanel inside the EdgeNavigation) means that the SideBar will ignore the top and bottom bars.