Commit Latest
This commit is contained in:
@@ -11,5 +11,5 @@
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:DataType="vm:ScottPlotViewModel"
|
||||
x:Class="PortfolioManager.Views.ScottPlotView">
|
||||
<ScottPlot:AvaPlot Name="AvaPlot"/>
|
||||
<ScottPlot:AvaPlot Name="AvaPlot" Loaded="AvaPlot_Loaded"/>
|
||||
</UserControl>
|
||||
|
||||
@@ -10,16 +10,22 @@ namespace PortfolioManager.Views;
|
||||
|
||||
public partial class ScottPlotView : UserControl
|
||||
{
|
||||
private AvaPlot avaPlot = default;
|
||||
public ScottPlotView()
|
||||
{
|
||||
InitializeComponent();
|
||||
AvaPlot avaPlot = this.Find<AvaPlot>("AvaPlot");
|
||||
avaPlot.Loaded += OnLoadedEvent(this, null);
|
||||
}
|
||||
|
||||
protected void OnLoadedEvent(object sender, EventArgs args)
|
||||
private void AvaPlot_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// if (null == tabControl) return;
|
||||
// tabControl.SelectedIndex = args.Index;
|
||||
// This code will execute when the AvaPlot is loaded
|
||||
if (sender is ScottPlot.Avalonia.AvaPlot)
|
||||
{
|
||||
if (default == avaPlot)
|
||||
{
|
||||
PlotterWorkspaceViewModel viewModel = (DataContext as PlotterWorkspaceViewModel);
|
||||
viewModel.OnPlotterLoaded(this.Find<AvaPlot>("AvaPlot"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user