Click here to Skip to main content
15,902,492 members

Comments by fre_ber (Top 6 by date)

fre_ber 8-Jan-14 10:19am View    
Thanks. I don't have any issues with using the code-behind of the views. At least not yet. I am an MVVM-noob. ;-)

I am using a serializer to store the layout state of these view objects - the main window and all the "workspace" views that it contains. Each "workspace" view has its own view model.

Would it be extremely bad to have the code-behind serialize it every time the layout is changed and make it send the serialized data to the view model for storage until it needs to be saved to a file?

Analogous to that - every time the view needs to lay itself out, it would first query the view model for the serialized data, deserialize it and then apply.

I haven't looked, but I am sure there are either events I can listen to or methods I can override to make this happen. I wonder if it will be overly "heavy" though.
fre_ber 7-Jan-14 12:43pm View    
I feared as much.

The thing is that the view, in this case the Avalon Docking Manager, holds a lot of state information that I need to be able to load and save. The "command" handlers for the load and save operations are in view model class of the main window - where else could they be?
fre_ber 1-Jan-14 14:14pm View    
Great, thanks!
The constraint that the "strings" had to be valid names was something you added, not I. So I am not sure how you'd expect me to anticipate that to be a requirement.

However, your proposed workaround - the first one with an "Undecorator" looks promising. I will try that approach.
fre_ber 1-Jan-14 12:57pm View    
How is your struct defined? You need to give scanf pointers to the char buffers.

Also, you can't simply add strings in C. Is it string concatenation wou want or adding integers?
fre_ber 1-Jan-14 10:49am View    
This looks great! Unfortunately some of these box types include characters that are not valid as names. For example "url ", note the space at the end, and the ones added by Apple such as "©art" with the copyright char at the beginning.