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
NuGet Package: DevExpress.Persistent.Base
#Declaration
#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.
#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 Vector
#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;
}
}
}