public DataModel() : base() { base.MapEntities = new ObservableCollection <IVisualElement>(); MapEntities.CollectionChanged += MapEntities_CollectionChanged; CurrentMap = new Map() { Width = 400, Height = 400 }; TerrainEnabled = true; // commands OpenMapCommand = new OpenMapCommand(this); SaveMapAsCommand = new SaveMapAsCommand(this); _saveMapCommand = new SaveMapCommand(this); _disableSourceUpdate = false; }
/// <summary> /// Monitor if the device is on/offline and enable/disable map saving accordingly /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e) { SaveMapCommand.ChangeCanExecute(); }