Skip to main content
.NET 6.0+

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.1.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 System.ComponentModel;
using DevExpress.Xpo;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
// ...
[DefaultProperty(nameof(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>(nameof(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 24.1\Components\XAF\FeatureCenter.NETFramework.XPO folder by default, or refer to the Feature Center demo online.

#EF Example

using System.ComponentModel;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
// ...
[DefaultProperty(nameof(Title)), NavigationItem(false)]
public class VectorMapsListEditorDemoObject : IAreaInfo {
    [Browsable(false)]
    public int ID { get; private set; }
    public string Title { get; set; }
    [Aggregated]
    public IList<MapsListEditorDemoObject> Stores { get; private set; } = new List<MapsListEditorDemoObject>();
    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