using System;
using ScottPlot.Avalonia;

namespace PortfolioManager.ViewModels
{
    public class PlotterLoadedEventArgs : EventArgs
    {
        public AvaPlot AvaPlot { get; set; } = default;
    }
    
    public abstract class PlotterWorkspaceViewModel : WorkspaceViewModel
    {
        public EventHandler<PlotterLoadedEventArgs> OnPlotterLoadedEventHandler;

        public void OnPlotterLoaded(AvaPlot avaPlot)
        {
            EventHandler<PlotterLoadedEventArgs> handler = this.OnPlotterLoadedEventHandler;
            if (null != handler) handler(this, new PlotterLoadedEventArgs() { AvaPlot = avaPlot });
        }
    }
}