Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF datagrid refreshes on it's own when it's not supposed to
    primarykey
    data
    text
    <p>I feel like I'm missing something here, but I have this datagrid which when the datasource changes, automatically redraws it self with no logical reason for it doing so.</p> <p>I have the datagrid bound to a DataView property which implements INotifyPropertyChanged and I want to do some other stuff when that event is fired before calling Refresh().</p> <p>So here is the datasource.</p> <pre><code>public class MainScreenDataView : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; void OnPropertyChanged(string name) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(name)); } } DataView _dataview; public DataView GetDataView { get { return _dataview; } set { _dataview = value; OnPropertyChanged("GetDataView"); } } public MainScreenDataView() { } } </code></pre> <p>And the binding (I call this in the constructor of the window)</p> <pre><code> public void MakeData() { MiddleMan midman = MiddleMan.Instance; midman.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(midman_PropertyChanged); //unrelated event for error messages midman.InstantiateAll(); Binding bind = new Binding(); bind.Source = midman.GetDict["contact"].GetDataView; //GetDict is a dictionary that holds instances of MainScreenDataView bind.UpdateSourceTrigger = UpdateSourceTrigger.Explicit; DG_Contacts.SetBinding(BetterDataGrid.ItemsSourceProperty, bind); } </code></pre> <p>The class that updates the DataView with data from a database has access to that same instance of MainScreenDataView as the window. The instance is kept in a dictionary in a singleton.</p> <p>Now I see no reason why the datagrid would refresh it self, I even tried removing the INotifyPropertyChanged stuff from MainScreenDataview and yet it keeps the same behavior.</p> <p>Guess there's something I'm missing here. Default behavior somewhere that needs to be overridden or something?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload