public void Close(object param) { if (param is StrategyViewModel strategy) { strategy.Dispose(); if (strategyObservableSubscriptions.TryGetValue(strategy.Strategy.Name, out IDisposable subscription)) { subscription.Dispose(); } strategyObservableSubscriptions.Remove(strategy.Strategy.Name); SelectedStrategyViewModels.Remove(strategy); } }
public void Close(object param) { var strategy = param as StrategyViewModel; if (strategy != null) { strategy.Dispose(); IDisposable subscription; if (strategyObservableSubscriptions.TryGetValue(strategy.Strategy.Name, out subscription)) { subscription.Dispose(); } strategyObservableSubscriptions.Remove(strategy.Strategy.Name); SelectedStrategyViewModels.Remove(strategy); } }