The requested page is not available for the requested platform. You are viewing the content for Default platform.

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.v19.1.dll

Declaration

public interface IAreaInfo
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 19.1\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