Commit Latest
This commit is contained in:
@@ -10,23 +10,23 @@ namespace PortfolioManager.Views;
|
||||
|
||||
public partial class ScottPlotView : UserControl
|
||||
{
|
||||
// private AvaPlot avaPlot = default;
|
||||
public ScottPlotView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public ScottPlotView()
|
||||
{
|
||||
this.DataContextChanged += OnDataContextChanged;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void AvaPlot_Loaded(object sender, RoutedEventArgs e)
|
||||
private void OnDataContextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (default != (sender as ScottPlotView))
|
||||
{
|
||||
// This code will execute when the AvaPlot is loaded
|
||||
// if (sender is ScottPlot.Avalonia.AvaPlot)
|
||||
// {
|
||||
// if (default == avaPlot)
|
||||
// {
|
||||
// PlotterWorkspaceViewModel viewModel = (DataContext as PlotterWorkspaceViewModel);
|
||||
// avaPlot = this.Find<AvaPlot>("AvaPlot");
|
||||
// viewModel.OnPlotterLoaded(avaPlot);
|
||||
// }
|
||||
// }
|
||||
ScottPlotView view = (sender as ScottPlotView);
|
||||
PlotterWorkspaceViewModel viewModel = (DataContext as PlotterWorkspaceViewModel);
|
||||
if (default == viewModel.Plotter)
|
||||
{
|
||||
viewModel.Plotter = new AvaPlot();
|
||||
viewModel.OnPlotterLoaded(viewModel.Plotter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user