c# - url which references an object -



c# - url which references an object -

i'm trying implement silverlight timeline application. problem if want fill timeline need refer xml file via url:

<timeline:timelinetray.urls> <timeline:uriinfo url="http://localhost:4444/monet.xml" /> </timeline:timelinetray.urls>

but elements shown on timeline aren't static. there several pages we're gonna utilize timeline. on runtime generate new, edit , delete items. had generate dynamic xml "document" via xdocument class (silverlight). worked fine saw have reference xml document via url:

urls

';' delimited list of info xmls events show. need specify parameter or timeline appear blank.

so well, how can solve problem? way bind xdocument viewmodel timeline won't work. don't want save generated xdocument able reference it. there way?

edit: found solution. it's through codebehind, though:

var doc = new xdocument( // stuff you'd ); timeline.resetevents(doc);

there's way generate events without generating xdocument.

i'd still answers if gets improve thought doesn't need codebehind.

if timeline command doesn't back upwards binding xdocument, , want xdocument in viewmodel, can implement own propertychanged handler in view's codebehind refresh timeline, e.g.

var myvm = this.datacontext myviewmodeltype; if (myvm != null) { myvm.propertychanged += (s, e) => { if (e.propertyname == "myxdocumentproperty") { this.timeline.resetevents(myvm.myxdocumentproperty); } }; }

then when vm sets myxdocumentproperty property, propertychanged fire , timeline refreshed.

c# xml silverlight url linq-to-xml

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -