Quantcast
Channel: CSLA .NET
Viewing all articles
Browse latest Browse all 764

CSLA / Reactive Extensions Serialization issue

$
0
0

Attempting to use CSLA (latest version) along with ReactiveUI and Reactive Extensions.

When creating the WPF bindings using reactiveUI, the underlying logic uses the reactive extensions Observable.FromEventPattern to hook into the CSLA model's PropertyChanged events in BindableBase.

The problem that is occurring is that CSLA believes that these handlers should be serializable.  

This is determined by the code,

if (value.Method.IsPublic &&            (value.Method.DeclaringType.IsSerializable ||             value.Method.IsStatic))          _serializableChangedHandlers = (PropertyChangedEventHandler)            System.Delegate.Combine(_serializableChangedHandlers, value);        else          _nonSerializableChangedHandlers = (PropertyChangedEventHandler)            System.Delegate.Combine(_nonSerializableChangedHandlers, value);
In this situation, the method is an anonymous delegate created within reactive extensions where
the value.Method is public and the value.Method.DeclaringType is System.Action`2[[System.Object],[System.ComponentModel.PropertyChangedEventArgs]] 
which is marked as IsSerializable is true
This causes the handler to be added to the serializable list.
Any suggestions on what I might be able to do to change this situation?

Viewing all articles
Browse latest Browse all 764

Trending Articles