Estoy intentando cuando interactúo con un interruptor, los demás van a falso, ¿alguien puede ayudarme? código XML:
<StackLayout dock="top" height="90%" width="100%" style=""> <StackLayout tap="{{ definicoesTap }}" > <Label text=" Voltar" paddingLeft="15%" class="drawerItemText font-awesome" /> </StackLayout> <StackLayout class="hr-light"></StackLayout> <StackLayout orientation="horizontal" marginTop="20" marginLeft="20"> <Switch id="notOFF" checkedChange="{{ teste }}" checked="False"/> <Label text="Desativar todas as notificações" style="color:#000;font-size:17" marginLeft="5" /> </StackLayout> <StackLayout orientation="horizontal" marginTop="20" marginLeft="20"> <Switch id="notON" checkedChange="{{ teste }}" checked="False"/> <Label text="Ativar todas as notificações" style="color:#000;font-size:17" marginLeft="5" /> </StackLayout> <StackLayout orientation="horizontal" marginTop="20" marginLeft="20"> <Switch id="notSMS" checkedChange="{{ teste }}" checked="False"/> <Label text="Ativar apenas mensagens" style="color:#000;font-size:17" marginLeft="5" /> </StackLayout> <StackLayout marginTop="20"> <Button text="Confirmar" tap="{{ definicoesTap }}" class="btn btn-secundary mt-20" /> </StackLayout> </StackLayout>Creé una función que se ejecuta cuando activo los interruptores, ahora quiero que cuando 1 sea verdadero, los demás sean falsos Código JavaScript:
viewModel.teste = (args) => { var objeto = args.object; if (objeto.checked == true) { switch (objeto.id) { case "notOFF": console.log("Todas as notificações desligadas") break case "notON": console.log("Todas as notificações ligadas") break case "notSMS": console.log("Apenas as notificações das mensagens") break } }}