Inheritance: INotifyPropertyChanged
 public WorldSurfaceWindow()
 {
     dataModel = new DataModel();
     InitializeComponent();
     this.DataContext = dataModel;
     AddActivationHandlers();
     SVEMap.MapStyle = InfoStrat.VE.VEMapStyle.Aerial;
     zoomItem.ZoomIn += MapZoomIn;
     zoomItem.ZoomOut += MapZoomOut;
     SVEMap.CameraChanged += new EventHandler<InfoStrat.VE.VECameraChangedEventArgs>(SVEMap_CameraChanged);
 }
示例#2
0
        public DataModel()
        {
            Instance = this;
            ObservableCollection<Location> newLocations = new ObservableCollection<Location>();
            //newLocations.Add(new Location() { Name="stv"});

            XmlSerializer deserializer = new XmlSerializer(typeof(ObservableCollection<Location>));
            TextReader textReader = new StreamReader("Resources\\CapgeminiLocations.xml");
            newLocations = (ObservableCollection<Location>)deserializer.Deserialize(textReader);
            textReader.Close();

            //XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection<Location>));
            //TextWriter textWriter = new StreamWriter("Resources\\CapgeminiLocations.xml");
            //serializer.Serialize(textWriter, newLocations);
            //textWriter.Close();

            _locations = newLocations;
            NotifyPropertyChanged("Locations");
        }