No more unbind method? RRS feed

  • Question

  • Still playing with the WinJS.Binding namespace...the docs mention the existence of an unbind method (http://msdn.microsoft.com/en-us/library/windows/apps/hh701630.aspx). However, it seems like it's gone without any trace. From the docs, I'm assuming that you can use it to cancel some of the binding notifications you'll be receiving after calling the bind method.

    Now, I'm just putting this here to be sure that, currently, the only way to cancel the bindings created from that method is to call cancel over the bind's returned object. Ex.:

    var aux = WinJS.Binding.bind(dados, {
                nome: function (valor) { document.getElementById("nome").value = valor; },
                morada: function (valor) { document.getElementById("morada").value = valor; }

    aux.cancel(); //no more notifications from now onward

    Am I right?


    Luis Abreu

    Friday, March 23, 2012 10:35 AM


  • Yes, it seems that way. cancel will simply cancel all notifications that you've defined in the bind method.

    Luis Abreu

    Friday, March 23, 2012 8:02 PM