how to open and close sidebar programaticaly

Hi, i’m wondering how can i open and close a sidebar programmatically. the code for my sidebar is pretty much the same as social media example

You can bind the Active property of the EdgeNavigator to an observable in JavaScript and then change the value of the observable in code.

In the case of the social media example this would look like:

ux:

<EdgeNavigator ux:Name="EdgeNavigator" Active="{activePage}">

JS:

activePage = Observable("");

function activateMenu(){
    activePage.value = "menu";
}

(you of course also have to add activePage and activateMenu to your module.exports).

To navigate away from the side menu you simply set activePage.value to something else (for instance an empty string)

navigation away from sidebar works but the sidebar doesnt close

EDIT: solved