/// <summary> /// Called on activation of the view model. /// </summary> protected async override void OnActivate() { _editedEffect = new EffectProtDisplay(); await Pull(); base.OnActivate(); }
/// <summary> /// Remove effect with the same type as edited effect. /// </summary> public async void Remove(string effectType) { var msg = await _data.Remove(_mapper.Map <EffectProtModel>(_editedEffect)); if (msg != null) { MessageBox.Show(msg, "Error", MessageBoxButton.OK, MessageBoxImage.Warning); return; } foreach (var effect in Effects.ToList()) { if (effect.EffectType == effectType) { Effects.Remove(effect); } } _editedEffect = new EffectProtDisplay(); SelectedEffect = null; }