public void AddOrUpdate(Guid plotId, BitmapImage image) { var plot = _plots.SingleOrDefault(p => p.PlotId == plotId); if (plot == null) { plot = new RPlot(this, plotId, image); _plots.Add(plot); } else { plot.Image = image; } ActiveIndex = _plots.IndexOf(plot); PlotCount = _plots.Count; PlotAddedOrUpdated?.Invoke(this, new RPlotEventArgs(plot)); }
public void AddOrUpdate(Guid plotId, object image) { var plot = _plots.SingleOrDefault(p => p.PlotId == plotId); if (plot == null) { plot = new RPlot(this, plotId, image); _plots.Add(plot); } else { plot.Image = image; } ActiveIndex = _plots.IndexOf(plot); PlotCount = _plots.Count; PlotAddedOrUpdated?.Invoke(this, new RPlotEventArgs(plot)); }