How do I find it belongs to?


I have many switch and slider. I want to control each of switch/slider properties. How can I do?

<App Theme="Basic"> 

        var Observable = require("FuseJS/Observable");

        var data = Observable(
            {name: "foo", dim_value: 10},
            {name: "bar", dim_value: 70},
            {name: "xoo", dim_value: 0},
            {name: "zoo", dim_value: 110},
            {name: "foo.2", dim_value: 10},
            {name: "bar.2", dim_value: 210},
            {name: "xoo.2", dim_value: 0}

        module.exports = {
            data: data,
            switchChanged: function (args) {
                console.log("Switch value is: " + args.value);


    <Panel ux:Class="MyPanel" Height="35" Margin="5,10" />

            <Each Items="{data}">
                <DockPanel Height="50" Margin="10,5">
                        <Text TextColor="#fff" Alignment="VerticalCenter" Value="{name}" />
                        <Slider Alignment="Center" Padding="5,10,10,10" Width="150" Value="{dim_value}" Minimum="0" Maximum="255" />

                        <Switch Value="False" ux:Name="TheSwitch" ValueChanged="{switchChanged}" Alignment="CenterRight" />
                        <WhileFloat Value="{dim_value}" GreaterThan="1" LessThan="255">
                            <Change TheSwitch.Value="True" />
                        </WhileFloat>                    </MyPanel>

                    <Rectangle Layer="Background" CornerRadius="15" Fill="#975A5E" />



LOG: Switch value is: true The results of which Switch?

Hi! identifies the object from your observable list that corresponds to the slider :slight_smile:

I love Fuse!