MVVM Details Form - New functionality

MVVM Details Form - New functionality

Old forum URL: forums.lhotka.net/forums/t/8499.aspx


Devman posted on Tuesday, February 09, 2010

Hi,

I have a details form which i use for editing/saving entities which current works a treat.  I want to add a "New" button which will allow me to create a new entity using the same form.

So, I hook up a button to a method in the relating viewmodel which contains the something like the following;

Model = new Factory.Create<Entity>(); 

The model is set to a new Entitiy instance and this clears down the form as expected, but when i try to poplute the Entity using the form Im not able to save the entity.

The Save button is disabled  (IsEnabled is bound to CanSave). If I remove the IsEnabled binding and click save i get an error "Object is not valid and cannot be saved". 

Any ideas?

Best Regards

David

 

 

triplea replied on Tuesday, February 09, 2010

Are you using the latest version (3.8.2)? I think you are hitting issue 091205 described here:

http://www.lhotka.net/Article.aspx?id=5fdcd957-bff6-449c-89d8-2c8b37079eff

Devman replied on Tuesday, February 09, 2010

We're using 3.8.0 so that explains the the CanSave not getting refreshed. I had noticed Model.IsDirty was true.

The other error is a validation error so that will be caused at my end.

Cheers triplea

 

 

 

 

Copyright (c) Marimer LLC