Los cambios en la base de datos no se guardan desde WP7 ViewModel

I have a view bound to a viewmodel that references a datacontext (linq to sql). The view renders great and displays the values that are in the database. Making changes to the values in the view correctly updates the values in the viewmodel, but when I attempt to submit the changes, navigate back from the page and then back to it, my changes are gone. Any ideas? Here's the code for my viewmodel:

public class WidgetViewModel : BaseViewModel
{
    private Widget _widget;
    public Widget Widget { get { return _widget; } set { _widget = value; NotifyPropertyChanged("Widget"); } }

    public WidgetViewModel(int id)
    {
        Widget = Context.Widgets.Single(m => m.Id == id);
    }

    public void Save()
    {
        Context.SubmitChanges();
    }
}

preguntado el 31 de enero de 12 a las 08:01

We'll need to see a bit more of your page lifecycle to help. Can you confirm whether your changes are making it to the database or not? -

Thanks. I'll try to get more info here the next time I'm on that project. -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.