DoRefreshMergePreservingLocalChanges Extension Method

Overview

Refreshes the UI baseline from a server snapshot while preserving local edits. Use this when:

Declaration

/// <summary>
/// Refreshes the observable data set while preserving local pending changes
/// </summary>
/// <param name="observableDataSet">Observable data set</param>
/// <param name="refreshedDataSet">Refreshed data set</param>
/// <param name="observableMergeOptions">Observable merge options</param>
public static void DoRefreshMergePreservingLocalChanges(this IObservableDataSet? observableDataSet, IDataSet refreshedDataSet, IObservableMergeOptions observableMergeOptions)

Namespace and Assembly

Namespace: PocoDataSet.ObservableExtensions
Assembly: PocoDataSet.ObservableExtensions.dll

Usage Example

// 1. Assuming observable data set is used for UI binding
IObservableDataSet boundObservableDataSet = new ObservableDataSet();

// The following line is a pseudo-code example of how UI can be bound to the observable data set.
// The actual binding code depends on the UI framework and is not part of POCO DataSet.
somePage.DataContext = boundObservableDataSet;

// 2. The UI decides to refresh itself from the server latest data
// Say, you got the response from the server as IDataSet into latestSnapshotFromServer variable:
IDataSet latestSnapshotFromServer = ...

// 3. Call RefreshPreservingLocalChanges method to refresh the UI with the latest snapshot from the server.
// The refresh applies while preserving all local edits.
IObservableMergeOptions options = new ObservableMergeOptions();
boundObservableDataSet.DoRefreshMergePreservingLocalChanges(latestSnapshotFromServer, options);

 

Table of Content POCO DataSet Observable Data Set Members

 


Business Process Programming in .Net
© 2004–2026 Laskarzhevsky Software Inc.
Unless otherwise noted, the content of this website is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Code examples are provided under the MIT License.
You are free to share and adapt the material provided that appropriate credit is given and any modifications are clearly indicated.
The information provided on this website is for educational purposes only.
The author and publisher make no warranties regarding the completeness or suitability of the information and are not responsible for any damages resulting from its use.