CSLA & Catel MVVM framework

CSLA & Catel MVVM framework

Old forum URL: forums.lhotka.net/forums/t/11001.aspx


kosta_t posted on Wednesday, December 21, 2011

Hi,

I have recently been doing some development with the Catel MVVM framework & have come up with an issue between Catel & CSLA.

When an object is removed from a BusinessList, the object is marked as dirty, which causes a call to OnUnknownPropertyChanged(). This in turn results in the call:

OnPropertyChanged(string.Empty)

which causes Catel to throw an exception complaining about the lack of a valid property name.

I have hacked a fix by changing the call in OnUnknownPropertyChanged() to:

 

OnPropertyChanged(

 

"__Unknown__Property__");

This fixes my immediate issue, but I don't like having to hack the CSLA library.

Does anyone have any better ideas on how to avoid/fix this issue?

JonnyBee replied on Wednesday, December 21, 2011

File an issue on the Catel framework. The Catel framework obviously does not conform to the documentation from Microsoft.

Read here: http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.propertychanged.aspx

Remarks


The PropertyChanged event can indicate all properties on the object have changed by using either Nothing or String.Empty as the property name in the PropertyChangedEventArgs.

kosta_t replied on Wednesday, December 21, 2011

Ok,

I will file with Catel & post back here when I have something to report...

RockfordLhotka replied on Friday, December 23, 2011

kosta_t

I have hacked a fix by changing the call in OnUnknownPropertyChanged() to:

OnPropertyChanged(

"__Unknown__Property__");

This fixes my immediate issue, but I don't like having to hack the CSLA library.

 

That may fix their framework, but it will break standard behavior for all Microsoft data binding technologies, so it is only useful if you never use data binding.

kosta_t replied on Monday, December 26, 2011

Hi, Catel now accepts calling OnPropertyChanged(String.Empty).

thanks for all your assistance.

Copyright (c) Marimer LLC