public AreaAndLengths()
{
InitializeComponent();
ESRI.ArcGIS.Client.Geometry.Envelope initialExtent =
new ESRI.ArcGIS.Client.Geometry.Envelope(
ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(
new ESRI.ArcGIS.Client.Geometry.MapPoint(-130, 20)),
ESRI.ArcGIS.Client.Bing.Transform.GeographicToWebMercator(
new ESRI.ArcGIS.Client.Geometry.MapPoint(-65, 55)));
initialExtent.SpatialReference = new SpatialReference(102100);
MyMap.Extent = initialExtent;
MyDrawObject = new Draw(MyMap)
{
DrawMode = DrawMode.Polygon,
IsEnabled = false,
FillSymbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.FillSymbol
};
MyDrawObject.DrawComplete += MyDrawObject_DrawComplete;
MyDrawObject.DrawBegin += MyDrawObject_DrawBegin;
List<CalculationType> enumVals = new List<CalculationType>();
foreach (var val in typeof(CalculationType).GetFields())
{
if (val.IsLiteral)
enumVals.Add((CalculationType)val.GetValue(typeof(CalculationType)));
}
CalcTypeListBox.ItemsSource = enumVals;
CalcTypeListBox.SelectedIndex = 0;
}