Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
Refreshing view does not refresh custom objects.
posted

We have created an app that relies on refreshing the view for the datapresenters instead of relying on INotifyPropertyChanged.  If we refresh the view, the values of the native types update just fine, but the custom objects don't.  The attached project contains a repro. 

DPTesting.zip
Parents
  • 890
    posted

    Hi,

    If I understand correctly the problem is that the firs column is not refreshing.
    From what I see in the code the reason the values remain the same is that in the C# code you are updating the Value property of the already created object (SubObject). After calling refresh since the object itself is the same the ToString method does not get called and as a result only the second column is changing. In order to update the first column as well you should create a new object and change its value.

    Replace:   parent.Child.Value = m_Rand.Next();
    With: parent.Child = new SubObject() { Value =  m_Rand.Next()};

     I am not sure if this will be of any use in that case.

    Thanks,
    Slavi

Reply Children
No Data