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
Post a Comment