c# - ListView SelectedItem not updating UI after ListView been cleared -


i'm using caliburn micro on windows store app.

i have listview has selecteditem works first time use it. however, when clear listview , re-bind collection, selected item no longer appears selected.

the selecteditem property being set correctly, since can hit breakpoint, , works has expected, view not being updated selected item, after clear collection.

what wrong?

thanks.

edit:

view code:

<listview x:name="detailnotes"           itemssource="{binding detailnotes}"           selecteditem="{binding selecteddetailnote}"                                             itemtemplate="{staticresource notes600itemtemplate}"           isitemclickenabled="true"           caliburn:message.attach="[event itemclick] = [detailnoteselected($eventargs)]"/> 

viewmodel code:

(...) private note selecteddetailnote;  public note selecteddetailnote {     { return this.selecteddetailnote; }     set      {          this.selecteddetailnote = value;          this.notifyofpropertychange(() => this.selecteddetailnote);      } }  (...)  public void detailnoteselected(itemclickeventargs eventargs) {     note n = (note)eventargs.clickeditem;     this.selecteddetailnote = n; } 

sorry! problem explicit binding. left caliburn work, , works! solution below:

view code:

<listview x:name="detailnotes"           itemtemplate="{staticresource notes600itemtemplate}"/> 

viewmodel code:

private note selecteddetailnote;  public note selecteddetailnote {     { return this.selecteddetailnote; }     set      {          this.selecteddetailnote = value;          this.notifyofpropertychange(() => this.selecteddetailnote);      } } 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -