Namespace: Semata.Lazy
Allows a property to be used in a Lazy manner. Its value is initialized by a the propertyGet delegate the first time it is accessed. The source needs to implement INotifyPropertySourceChanged, and raise PropertySourceChanged when the value needs to be reinitialized. Once the value is initialized, LazyProperty susbscribes to the source's PropertySourceChanged event. When this event, with the correct name, is received, the value is retrived once again by propertyGet If a propertySet delegate is provided LazyProperty is read/write. Otherwise it is readonly. There is an option to provide a delegate that is called when PropertySourceChanged is received. The value is only initialized by get, not set. So PropertySourceChanged will not be subscribed to if ony set is used
public class LazyProperty<T>
Constructors
Name | Description |
LazyProperty(INotifyPropertySourceChanged, string, Func<T>, Action<T>, Func<T, bool>) |
Creates the LazyProperty. |
LazyProperty(INotifyPropertySourceChanged, string, Func<T>, Action<T>, Func<T, bool>, Action<LazyProperty<T>>) |
Creates the LazyProperty. |
Properties
Name | Description |
IsInitialized |
Has the value been initialized |
Value |
The value |