示例#1
0
        private void GlobalMapViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == GlobalMapsViewModel.SelectedSectorPropertyName)
            {
                GlobalMapsViewModel _mapsViewModel = (GlobalMapsViewModel)sender;
                if (_mapsViewModel.SelectedSector != null)
                {
                    string _mapFileName = String.Format("{0}.DAT", _mapsViewModel.SelectedSector);
                    _mapFileName = Path.Combine(this.FMapFolder, _mapFileName);

                    try
                    {
                        this.ViewModel.MapFileName = _mapFileName;
                    }
                    catch (Exception _exc)
                    {
                        MessageBox.Show(_exc.Message, "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning);
                    }
                }
            }
        }
示例#2
0
 public GlobalMapsView()
 {
     this.ViewModel = new GlobalMapsViewModel();
     InitializeComponent();
 }