EntityCollectionChangedParams Class
Encapsulates the arguments of a CollectionChanged delegate.
Assembly: System.Data.Services.Client (in System.Data.Services.Client.dll)
| Name | Description | |
|---|---|---|
![]() | Action | A NotifyCollectionChangedAction value that indicates how the collection was changed. |
![]() | Collection | The DataServiceCollection<T> that has changed. |
![]() | Context | The DataServiceContext associated with the DataServiceCollection<T> that has changed. |
![]() | PropertyName | The navigation property on the source object that references the collection that has changed. |
![]() | SourceEntity | The source object that references the target object in the collection by using a navigation property. |
![]() | SourceEntitySet | The entity set of the source object. |
![]() | TargetEntity | The entity object in the collection that has changed. |
![]() | TargetEntitySet | The entity set name of the object in the collection. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
The following code-behind page for the XAML file creates a DataServiceCollection<T> with custom methods that are called when changes occur to data that is bound to the binding collection. When the CollectionChanged event occurs, the supplied method prevents an item that has been removed from the binding collection from being deleted from the data service. When the PropertyChanged event occurs, the ShipDate value is validated to ensure that changes are not made to orders that have already shipped.
The following XAML code defines the window for the previous example.
<Window x:Class="CustomerOrdersCustom" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="423" Width="679" Loaded="Window_Loaded" > <StackPanel Orientation="Vertical" Height="Auto" Name="LayoutRoot" Width="Auto"> <Label Content="Customer ID" Margin="20,0,0,0" /> <ComboBox Name="customerIDComboBox" DisplayMemberPath="CustomerID" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" SelectedIndex="0" Height="23" Width="120" HorizontalAlignment="Left" Margin="20,0,0,0" VerticalAlignment="Center" /> <ListView ItemsSource="{Binding Path=Orders}" Name="ordersDataGrid" Margin="34,46,34,50"> <ListView.View> <GridView AllowsColumnReorder="False" ColumnHeaderToolTip="Line Items"> <GridViewColumn DisplayMemberBinding="{Binding Path=OrderID, Mode=OneWay}" Header="Order ID" Width="50"/> <GridViewColumn DisplayMemberBinding="{Binding Path=OrderDate, Mode=TwoWay}" Header="Order Date" Width="50"/> <GridViewColumn DisplayMemberBinding="{Binding Path=Freight, Mode=TwoWay}" Header="Freight Cost" Width="50"/> </GridView> </ListView.View> </ListView> <StackPanel Orientation="Horizontal"> <Button Name="deleteButton" Content="Delete Order" Click="deleteButton_Click" Width="80" Height="30" Margin="450,0,10,0"/> <Button Name="saveChangesButton" Content="Save Changes" Click="saveChangesButton_Click" Width="80" Height="30" Margin="10,0,0,0"/> </StackPanel> </StackPanel> </Window>
Available since 3.5
Silverlight
Available since 4.0
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

