Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm having some difficulty following the hierarchy of items that you're displaying, but I believe the answer you're looking for is simple: you must implement the <code>INotifyPropertyChanged</code> interface on the class (or classes) that contain properties that you will be changing in response to a change in <code>CurrentThumbnail</code>. As I understand your question, you're not in doubt about how to update the thumbnail data when the currently selected size changes, you're just wondering how to telegraph the fact that you've changed the data to your data binding. That's what <code>INotifiyPropertyChanged</code> is for.</p> <p>For example, this version of <code>ThumbnailImage</code> will telegraph changes in the <code>Path</code> property to any XAML attribute that is bound to <code>Path</code>:</p> <pre><code>public class ThumbnailImage : INotifyPropertyChanged { private string _path; public string Path { get { return _path; } set { if (value != _path) { _path = value; if (PropertyChanged != null) { var args = new PropertyChangedEventArgs("Path"); PropertyChanged(this, args); } } } } public event PropertyChangedEventHandler PropertyChanged; } </code></pre> <p>I would also suggest that you make sure the hierarchy of classes that you're using to represent the data that is displayed (all of these classes are essentially part of your view model) should match the hierarchy of your XAML. It's hard to tell because you haven't given us the complete XAML layout, but I suspect your data model may be one level too complex. In other words, consider flattening your data tree.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload