locked
how to update oneTime binding

    Question

  • Hi.

    In C++/XAML i can throw binding update (i mean notify system that value of any property was changed) using 

    PropertyChanged( this, ref new PropertyChangedEventArgs( propertyName));

    but how can i do this in JavaScript when i using oneTime binding (need to use it as i use classes from C++ component to show up in UI and these classes cannot be expanded with _getObservable) ?



    Wednesday, June 05, 2013 9:36 AM

Answers

  • Girija, thanks for your response. As i've wrote these classes are from C++ component so cannot be expanded to observable class (so i cannot use Binding.as).

    I had a problem with items in ListView where i need update property of any item (these items are from C++ component). As a workaround i've added an event which is called from C++ :

    function updateUI(item){
      var pos = DataSource.currentList.indexOf(item);
      if( pos >= 0)
        DataSource.currentList.setAt( pos, item); // this will throw rebind as i needed
    }


    Wednesday, June 05, 2013 8:11 PM

All replies

  • Not sure but this might just work.. Before binding make those objects observable using WinJS.Binding.as .

    - Girija


    Please mark responses as answered if it helped you.. This helps others... - Girija Shankar Beuria

    Wednesday, June 05, 2013 8:03 PM
  • Girija, thanks for your response. As i've wrote these classes are from C++ component so cannot be expanded to observable class (so i cannot use Binding.as).

    I had a problem with items in ListView where i need update property of any item (these items are from C++ component). As a workaround i've added an event which is called from C++ :

    function updateUI(item){
      var pos = DataSource.currentList.indexOf(item);
      if( pos >= 0)
        DataSource.currentList.setAt( pos, item); // this will throw rebind as i needed
    }


    Wednesday, June 05, 2013 8:11 PM