using System;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Forms;
using GeoAPI.Geometries;
using Application = System.Windows.Application;
using MenuItem = System.Windows.Controls.MenuItem;
namespace WPFSamples
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
var gss = GeoAPI.GeometryServiceProvider.Instance;
var css = new SharpMap.CoordinateSystems.CoordinateSystemServices(
new ProjNet.CoordinateSystems.CoordinateSystemFactory(),
new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory(),
SharpMap.Converters.WellKnownText.SpatialReference.GetAllReferenceSystems());
GeoAPI.GeometryServiceProvider.Instance = gss;
SharpMap.Session.Instance
.SetGeometryServices(gss)
.SetCoordinateSystemServices(css)
.SetCoordinateSystemRepository(css);
}
private void MenuItem_OnClick(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
private void BgOSM_OnClick(object sender, RoutedEventArgs e)
{
WpfMap.BackgroundLayer = new SharpMap.Layers.TileAsyncLayer(BruTile.Predefined.KnownTileSources.Create(), "OSM");
foreach (var menuItem in Menu.Items.OfType