Skip to main content
A newer version of this page is available. .

How to: Delay Property Loading

This example demonstrates how to delay the loading of the Photo property. This property will be loaded the first time it is accessed.


using DevExpress.Xpo;

public class Person : XPObject {
    public Person(Session session) : base(session) { }

    [ValueConverter(typeof(DevExpress.Xpo.Metadata.ImageValueConverter)), Delayed]
    public System.Drawing.Image Photo {
        get { return GetDelayedPropertyValue<System.Drawing.Image>("Photo"); }
        set { SetDelayedPropertyValue<System.Drawing.Image>("Photo", value); }
    }
}
See Also