Files
Avalonia/PortfolioManager/Views/BollingerBandView.axaml.cs
2025-06-28 23:49:24 -04:00

32 lines
840 B
C#

using System;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using PortfolioManager.ViewModels;
using ScottPlot.Avalonia;
namespace PortfolioManager.Views;
public partial class BollingerBandView : UserControl
{
public BollingerBandView()
{
this.DataContextChanged += OnDataContextChanged;
InitializeComponent();
}
private void OnDataContextChanged(object sender, EventArgs e)
{
if (default != (sender as BollingerBandView))
{
BollingerBandView view = (sender as BollingerBandView);
PlotterWorkspaceViewModel viewModel = (DataContext as PlotterWorkspaceViewModel);
if (null!=viewModel && default == viewModel.Plotter)
{
viewModel.Plotter = new AvaPlot();
viewModel.OnPlotterLoaded(viewModel.Plotter);
}
}
}
}