Wrapping objects using Obtics

Jul 20, 2010 at 10:09 PM
Edited Jul 23, 2010 at 1:28 PM
Problem:    I have a collection of models which I would like to wrap with viewmodels and then present them to the UI as a collectionview. It all worked well except when I attempted to remove a model from the source collection an exception would be thrown, no such object at position x; It appeared to be attempting to remove an object from the viewmodel collection twice.

Solution:    Reading http://obtics.codeplex.com/wikipage?title=Well-behaved lead me to realize that for Obtics to function it needs a way to relate models to viewmodels after the expression was executed. My solution to this was to overload the Equals(object obj) function in the viewmodel and handle both cases of equality, viewmodel == viewmodel and model == viewmodel.

-Peter
Jul 21, 2010 at 2:30 PM
Edited Jul 21, 2010 at 2:40 PM
...
Coordinator
Jul 23, 2010 at 7:45 AM

? Ignore what ?

If you had an issue and later found a solution other people might be interested.

Regs,

Thomas

 

Jul 23, 2010 at 1:17 PM
The solution was to read your documentation ;) but I guess I could put up a solution.