public WriteableBitmap ToBitmap()
{
if (((this.Map == null) || double.IsNaN(this.Map.ActualWidth)) || ((double.IsNaN(this.Map.ActualHeight) || (this.Map.ActualWidth < 1.0)) || (this.Map.ActualWidth < 1.0)))
{
return null;
}
WriteableBitmap bitmap = new WriteableBitmap((int)this.Map.ActualWidth, (int)this.Map.ActualHeight);
Point point = this.Container.TransformToVisual(this.Map).Transform(new Point(0.0, 0.0));
TranslateTransform transform = new TranslateTransform { X = point.X, Y = point.Y };
bitmap.Render(this.Container, transform);
bitmap.Invalidate();
return bitmap;
}