Sorry if the title is confusing but I don't really know how to shorten my question. Anyway, here it goes.
I'm using WPF, Entity Framework and MVVM.
Currently, in my ViewModel, I have a property
public Model.Document Document {get;set;} //Model.Document is an EF Entity
Then, in XAML, I bind to
<TextBox Text={Binding Path=Document.Title}/>
Title is of course a Property on the Model.
Now following question came to my mind: To separate the Model from the View, wouldn't it be better if I added a property to the ViewModel like so
public string Title
{
get { return Document.Title; }
set { Document.Title = value; }
}
and then bind like this:
<TextBox Text={Binding Path=Title}/>
Which way is recommended?