tag:blogger.com,1999:blog-5295746446529817470.post5185740490437692065..comments2023-05-09T16:29:24.130+02:00Comments on Dotnet by Example: Tombstoning MVVMLight ViewModels with SilverlightSerializer on Windows Phone 7Joost van Schaikhttp://www.blogger.com/profile/02182444268071162776noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-5295746446529817470.post-39871801073330664302012-11-26T22:50:08.727+01:002012-11-26T22:50:08.727+01:00Hi Joost, thank you for the feedback! I will let y...Hi Joost, thank you for the feedback! I will let you know, which solution I will spit out in the next few days. I looked also at the Sterling OODB from Jeremy Likness, which he - if he has time - will update also for WP8 and I want to see, if I can create serializers for standard WP7 and 8 controls, where it makes sense. Best, Ilija@awsomedevisgerhttps://www.blogger.com/profile/03459202875696842013noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-80132989398779870872012-11-26T21:33:39.646+01:002012-11-26T21:33:39.646+01:00Hi @awsomedevisger I would go for an interface as ...Hi @awsomedevisger I would go for an interface as well. Personally I would instantiate the implementation of your ITombstoneWhatever in the App.Xaml.cs and then store it in Laurent Bugnion's SimpleIoc so you can retrieve it everywhere. Dunno if that's a service. It works ;-)Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-47305920400165176762012-11-26T19:19:24.151+01:002012-11-26T19:19:24.151+01:00Hi Joost, I like the way you handle the stuff with...Hi Joost, I like the way you handle the stuff with extension methods :) I would like to think about a more flexible approach to add maybe additional methods to save the stuff to a database. Would you suggest creating a service for that, or suggest to add only additional methods? I would tend to a ITombstoneHelper to implement the stuff. Thank you.@awsomedevisgerhttps://www.blogger.com/profile/03459202875696842013noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-20771327734594726862011-05-17T08:39:23.133+02:002011-05-17T08:39:23.133+02:00@Priya thanks for you kind comments. I indeed use ...@Priya thanks for you kind comments. I indeed use a kind of ViewModelLocator, usually called MainViewModel. That more or less creates all the other ViewModels on demand. But there are some ViewModels that exist on their own, like my AboutViewModel, that is simply created by XAML as a static resource.Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-71325805462335860042011-05-16T11:14:36.052+02:002011-05-16T11:14:36.052+02:00Thanks for the great article. I do have a question...Thanks for the great article. I do have a question related to the place where you're restoring the VM. As you know, in MVVMLight, one typically relies on the ViewModelLocator to make VM instances available. How would that tie in with the whole tombstoning thing? Or are you not using the ViewModelLocator in your example? <br />Thanks,<br />PriyaPriyahttps://www.blogger.com/profile/03564953710596261212noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-37922605977710872232011-05-14T10:09:58.808+02:002011-05-14T10:09:58.808+02:00Indeed Matthias you are missing something very sim...Indeed Matthias you are missing something very simple error, but unfortunately it was one I made myself. The this.RetrieveFromIsolatedStorage() must be this.RetrieveFromIsolatedStorage<MyMainViewModel>() It was there in text, but I apparently forgot URLescape the sample code. My bad. Thanks for noticing thisJoost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-77085601527842521942011-05-13T23:29:01.030+02:002011-05-13T23:29:01.030+02:00Hopefully not a stupid question, but "this.Re...Hopefully not a stupid question, but "this.RetrieveFromIsolatedStorage()" is giving me a "the type arguments for method [blah blah blah] cannot be inferred from the usage" error. <br /><br />Surely, I'm missing something very simple.Matthiashttps://www.blogger.com/profile/12678077135408896545noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-73642611270473881652011-04-19T14:08:42.744+02:002011-04-19T14:08:42.744+02:00@Sankar, if you check this article http://dotnetb...@Sankar, if you check this article http://dotnetbyexample.blogspot.com/2011/04/bing-maps-control-with-mvvmlight-on.html you will find this <br />http://www.schaikweb.net/dotnetmag/MapBindingDemo.zip link at the bottom that shows how I implement tombstoning with SilverlightSerializer. Good luck!Joost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-80523407134262154782011-04-18T14:37:47.349+02:002011-04-18T14:37:47.349+02:00hi, Could you please provide sample example on &qu...hi, Could you please provide sample example on "Tombstoning MVVMLight ViewModels with SilverlightSerializer on Windows Phone 7".Please provie me as soon as possible thank you..Sankarhttps://www.blogger.com/profile/17012748951240995306noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-82980330745757601372011-01-13T09:06:20.993+01:002011-01-13T09:06:20.993+01:00My word. You are right. ThanksMy word. You are right. ThanksJoost van Schaikhttps://www.blogger.com/profile/02182444268071162776noreply@blogger.comtag:blogger.com,1999:blog-5295746446529817470.post-48613596325222959082011-01-13T08:50:36.043+01:002011-01-13T08:50:36.043+01:00The "if( MyMainViewModel.Instance ) == null M...<a href="http://twitter.com/peSHIr/status/25459388068134912" rel="nofollow">The "if( MyMainViewModel.Instance ) == null MyMainViewModel.CreateNew();" seems to be in two minds. CreateNew or null?</a>peSHIrhttps://www.blogger.com/profile/14895291650174860198noreply@blogger.com