c# - wpf window holds old data after reopening -


i have window displaying a flowdocument binded richtextbox in view. make document use collections a different viewmodel.

the first time open window works expected, second time or time after still holds data first time window opened , looks generatereport method doesn't fire again.

how can rid of old data , make generatereport method gets updated data.

this viewmodel looks like

public class reportviewmodel : viewmodelbase {     private string _shotlistreport;     public string shotlistreport   // name property     {         { return _shotlistreport; }         set { _shotlistreport = value; raisepropertychanged(""); }     }        public reportviewmodel (shotlistviewmodel shotlistviewmodel)     {         shotlist = shotlistviewmodel.allshots;         scenelist = shotlistviewmodel.scenecollectionview;          generatereport();     }      public listcollectionview scenelist { get; set; }     public observablecollection<shot> shotlist { get; set; }      private void generatereport()     {         flowdocument doc = new flowdocument();          //do stuff          shotlistreport = new textrange(doc.contentstart, doc.contentend).text;      }    } 


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -