/GPX.Firemap.Client/Modules/Views/GridReferenceMapView.xaml.cs
C# | 86 lines | 69 code | 17 blank | 0 comment | 2 complexity | c2e7d5c966b06b6e8fab55fe742887a6 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Shapes;
- using ESRI.ArcGIS.Client.Geometry;
- using ESRI.ArcGIS.Client.Tasks;
- using ESRI.ArcGIS.Client;
- using Geocortex.EssentialsSilverlightViewer.Infrastructure.Configuration;
- using System.ComponentModel.Composition;
- using Microsoft.Practices.Prism.Events;
- using Geocortex.EssentialsSilverlightViewer.Infrastructure.Events;
- using Geocortex.EssentialsSilverlightViewer.Infrastructure.Commands;
- using GPX.Geocortex.Models;
-
- namespace GPX.Geocortex.Views
- {
- public partial class GridReferenceMapView : ChildWindow, IConfigurableView, IPartImportsSatisfiedNotification
- {
-
- public Graphic selectedGraphic;
- private Envelope _initialExtent;
-
- [Import]
- public IEventAggregator EventAggregator { get; set; }
-
-
- public GridReferenceMapView(Envelope defaultExtent)
- {
- InitializeComponent();
- _initialExtent = defaultExtent;
- mapGridRefs.Extent = _initialExtent;
-
- }
-
- #region IConfigurableView Members
-
- public void InjectViewModel(object viewModel)
- {
-
- this.DataContext = (GridReferenceMapViewModel)viewModel;
- }
-
- public System.Type ViewModelType
- {
- get { return typeof(GridReferenceMapViewModel); }
- }
-
- #endregion
-
- #region IConfigurationInjection Members
- public string ModuleXmlConfiguration { get; set; }
- public string ViewXmlConfiguration { get; set; }
- #endregion
-
- public void OnImportsSatisfied()
- {
- EventAggregator.GetEvent<SiteInitializedEvent>().Subscribe(HandleEvent);
-
- }
-
- public void HandleEvent(SiteInitializedEventArgs args)
- {
- ShellCommands.BringToFront.Execute(this);
- }
-
- private void btnFullExtent_Click(object sender, RoutedEventArgs e)
- {
- this.mapGridRefs.ZoomTo(_initialExtent);
- }
-
- private void btnClose_Click(object sender, RoutedEventArgs e)
- {
- if (NavigateState.SelectedGraphic != null)
- this.Close();
- else
- MessageBox.Show("Please select a coordinate before exiting");
- }
- }
- }