locked
better change tracking planned for DataServiceContext ? RRS feed

  • Question


  • When a UI element bound (WPF) to a property of an entity tracked by a DataServiceContext is changed, the binding executes and the property is changed but the State of the entity remains Unchanged.

    For example:

    if property MyProperty of MyEntity is bound to a WPF TextBox:

    <TextBlock Text="{Binding MyProperty}"

    looking at myServiceContext.Entities shows EntityDescriptor for myEntity to be == Unchanged requiring a call to myServiceContext.UpdateObject(myEntity).

    Are there plans to have DataServiceContext track this change automatically? 

    Or have code generated from DataServiceUtil.exe provide this tracking and/or implement INotityPropertyChanged (I see the partial method hooks to do so are already there)?

    Thanks.

    Zac Morris


    Friday, June 6, 2008 3:15 PM

Answers

  • Hi,

     

    We don't plan to support INotifyPropertyChanged and related interfaces in this release; we stayed with the basics this round. We do consider the scenario important and will probably address it in a future release.

     

    We have a work-in-progress sample on how to do winforms/wpf binding on top of a model without having to modify the generated classes, we'll post it once it's in reasonable shape. As you mention, given that we generate all partial classes, one option is to implement the binding support in a partial class.

     

    Pablo Castro
    Software Architect
    Microsoft Corporation
    http://blogs.msdn.com/pablo

     

    Saturday, June 7, 2008 1:13 AM
    Moderator

All replies

  • Hi,

     

    We don't plan to support INotifyPropertyChanged and related interfaces in this release; we stayed with the basics this round. We do consider the scenario important and will probably address it in a future release.

     

    We have a work-in-progress sample on how to do winforms/wpf binding on top of a model without having to modify the generated classes, we'll post it once it's in reasonable shape. As you mention, given that we generate all partial classes, one option is to implement the binding support in a partial class.

     

    Pablo Castro
    Software Architect
    Microsoft Corporation
    http://blogs.msdn.com/pablo

     

    Saturday, June 7, 2008 1:13 AM
    Moderator
  • Was this sample ever posted?
    Tuesday, October 7, 2008 7:12 PM
  • Same here -
    Was this sample ever posted?

    Friday, October 10, 2008 1:46 PM