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

IAreaInfo Interface

Declares properties of business objects that can be displayed as an area on a vector map using the Maps Module.

Namespace: DevExpress.Persistent.Base

Assembly: DevExpress.Persistent.Base.v18.2.dll

Declaration

public interface IAreaInfo

Remarks

You can implement this interface in an XPO or Entity Framework business object. As a result, the WebVectorMapsListEditor will be used to display List Views of this business object. Each object is displayed as a map area. An object’s Detail View is displayed after clicking an area.

WebVectorMapsListEditor_Areas

XPO Example

using DevExpress.Xpo;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
// ...
[DefaultProperty("Title"), NavigationItem(false)]
public class VectorMapsListEditorDemoObject : BaseObject, IAreaInfo {
    public VectorMapsListEditorDemoObject(Session session) : base(session) { }
    public string Title { get; set; }
    [Association("USAState-Stores"), Aggregated]
    public XPCollection<MapsListEditorDemoObject> Stores {
        get { return GetCollection<MapsListEditorDemoObject>("Stores"); }
    }
    string IAreaInfo.Tooltip {
        get {
            string tooltipStr = Title;
            int storesCount = Stores.Count;
            if(storesCount > 0) {
                tooltipStr += string.Format("<br> {0} store{1}", storesCount, storesCount == 1 ? "" : "s");
            }
            return tooltipStr;
        }
    }
    float IAreaInfo.Value {
        get {
            return Stores.Count;
        }
    }
}

Note

See the complete example in the VectorMapsListEditorDemoObject.cs file in the Feature Center demo that is installed in the %PUBLIC%\Documents\DevExpress Demos 18.2\Components\eXpressApp Framework\FeatureCenter folder by default, or refer to the Feature Center demo online.

EF Example

using DevExpress.Persistent.Base;
// ...
[DefaultProperty("Title"), NavigationItem(false)]
public class VectorMapsListEditorDemoObject : IAreaInfo {
    [Browsable(false)]
    public int ID { get; private set; }
    public string Title { get; set; }
    [Association("USAState-Stores"), Aggregated]
    public XPCollection<MapsListEditorDemoObject> Stores {
        get { return GetCollection<MapsListEditorDemoObject>("Stores"); }
    }
    string IAreaInfo.Tooltip {
        get {
            string tooltipStr = Title;
            int storesCount = Stores.Count;
            if(storesCount > 0) {
                tooltipStr += string.Format("<br> {0} store{1}", storesCount, storesCount == 1 ? "" : "s");
            }
            return tooltipStr;
        }
    }
    float IAreaInfo.Value {
        get {
            return Stores.Count;
        }
    }
}
See Also