problem with Undo/Redo
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


««12

problem with Undo/Redo Expand / Collapse
Author
Message
Posted 2010-03-24 20:46:48
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Today @ 20:20:07
Posts: 241, Visits: 7 537
I can't help but think the way you describe your problem, it is a model problem, not a UI problem. (I apologize for not opening your sample app prior to this post so I hope I do not go off subject here)

My example: If you have derrived property like NamePresentationWidth, which is some calulated width based on a Name property multiplied by a Font factor, then the Font selection should be part of the/a model and databound in some fashion. Then, if either of the objects settable properties are changed (Name or Font), the derived property will report changed.

I guess my point is: even if you only have a need for this in memory while a UI view is active, it is still a model, just a model to store the data/state of a veiw. IMHO, that is exactly what a ViewModel was originally intended to be. So, it may not belong directly in your data model (I would need to know more ot comment further) it still is something to do in a standard model fashion.

Hope that helps.

Rick Weyrauch

Post #5042
Posted 2010-03-24 21:23:06
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 2012-01-26 14:59:09
Posts: 242, Visits: 828
Hi Rick,

I agree the purest approach would be to hold all the information in the model and use derived attribute. However in my real situation (the sample is very simplifyed) I have a diagram with a plenty of elements of different types, each of them has plenty of properties, the most of them ate managed by specialized framework. The only thing I need to manage in model is the serialized diagram that depends on all these elements and their properties. The framework makes xml-serialization automatically, so it would be not practicable to neglect this feature and to construct xml with model means. My point is to reduce the amount of these serializations - because of that I came to the idea to do it on Idle.

I hope you understand my motivation now.

/Efim

Post #5043
« Prev Topic | Next Topic »

««12

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom, PeterMorris

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 9:38

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0,156. 8 queries. Compression Disabled.