Thetype exposes the following members.
Gets a copy of the BoundingBox that represents this GeoFence.
used to fill the GeoFence, or null for no fill.
used to draw the border around the GeoFence, or null for no border.
Gets the RenderMode required by this RectangleFence.
Check whether the given LatLon lies within the borders of this GeoFence.
Determines whether the specified object is equal to the current object.(Inherited from .)
Serves as the default hash function.(Inherited from .)
Gets the(Inherited from of the current instance. .)
Render this GeoFence on the specified IMap.
Returns a string that represents the current object.(Inherited from .)
Related articles: Geofences Concept.
RectangleFence rf = new RectangleFence(); // to set the boundaries of the rectangle fence, // we need to create a bounding box // and assign it to the Box field BoundingBox bb = new BoundingBox(); bb.Add(new LatLon(33.581, -117.726)); bb.Add(new LatLon(32.588, -117.728)); rf.Box = bb; // Note: to edit the dimensions of the RectangleFence, // use the methods of rf.Box. (e.g. by calling AddPoint or InflateBy). // Now draw the RectangleFence on our map myMap.Renderer = rf;
The example above uses RectangleBox.Box to set the dimensions of the RectangleFence. You can use RectangleBox.Box to manipulate the RectangleFence. Do not try to manipulate the RectangleFence using its BoundingBox property. RectangleBox.BoundingBox returns a copy of the RectangleFence, so changing its property has no effect on the RectangleFence.
The same geofence can also be created using only XAML code. See PolygonFence for an example.