/// <summary> /// Attach the specified Model and View. /// </summary> /// <param name="model">The model</param> /// <param name="view">The view</param> /// <param name="explorerPresenter">The parent explorer presenter</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.map = model as Map; this.view = view as MapView; this.explorerPresenter = explorerPresenter; // Tell the view to populate the axis. this.PopulateView(); this.view.Zoom = map.Zoom; this.view.Center = map.Center; this.view.ZoomChanged += OnZoomChanged; this.view.PositionChanged += OnPositionChanged; }
/// <summary> /// Setup the map extensions objects. /// All named objects inside the map extensions will have its references properly set /// </summary> /// <param name="map">The map that uses the map extensions</param> private void MapExtensionsSetup(Map map) { MapsSettings.ApplicationContext.ApplicationId = "59ce70ce-9604-4bec-8330-79bcce797eed"; MapsSettings.ApplicationContext.AuthenticationToken = "s8KBiJZJfTtEIg625x87wA"; ObservableCollection<DependencyObject> children = MapExtensions.GetChildren(map); var runtimeFields = this.GetType().GetRuntimeFields(); foreach (DependencyObject i in children) { var info = i.GetType().GetProperty("Name"); if (info != null) { string name = (string)info.GetValue(i); if (name != null) { foreach (FieldInfo j in runtimeFields) { if (j.Name == name) { j.SetValue(this, i); break; } } } } } this.obdUpdatesMapItemsControl.ItemsSource = App.MainViewModel.MapObdUpdates; }
partial void UpdateMap(Map instance);
partial void DeleteMap(Map instance);
partial void InsertMap(Map instance);