Any example on basic use of Match and Case?

I’m wondering if this is what I’m looking for to control my navigation…

Match case is mostly used for placing different types of elements based on some value

For example:

    var Observable = require("FuseJS/Observable");
    var someValue = Observable("someString");
    module.exports = { someValue : someValue };
    <Match Value="{someString}">
        <Case String="someValue">
            <Text TextColor="#fff" Value="String is some value"/>
        <Case String="someOtherValue">
            <Text TextColor="#f00" Value="String is some other value"/>
           <Case Bool="true">
            <!--if the value is of type bool and is true, this case is used-->

For controlling navigation, you would usually change the Active property on your Navigation, either by databinding to JS or using a Change or Set animator.

Could you ellaborate some more on what you are trying to do?

Thank you! That’s all I needed…

The purpose is to get rid of nonsense code like this in my .js:

    menuDiscNav: {
        if (op=="content") return "hamburger";
        if (op=="sidebar") return "close";
        return "back";
    showMainView: {
        var ret = op=="content" || op=="sidebar";
        return ret;
    showSidebar: {
        var ret = op=="sidebar";
        return ret;
    showTrioMessage: {
        var ret = op=="error" || op=="trio";
        return ret;
    trioErrorActive: {
        var ret = op=="error";
        return ret;

More concretely: I have a variable called “mainView” that can be one of “trio”, “error”, “sidebar” and “content”. The user interface animates in fancy ways to switch between the four modes, so there’s a few different things that need to be controlled. Hence the above javascript-mess before you showed me how to use Match

Yeah, this is exactly what Match/Case is for. I love that feature, glad it was useful to you as well :smiley: