Commit Latest

This commit is contained in:
2025-06-24 19:34:26 -04:00
parent d1a8d73ead
commit 5c5ed13061
5 changed files with 345 additions and 43 deletions

View File

@@ -22,7 +22,7 @@
<local:OSValueConverter x:Key="OSValueConverter"/>
</UserControl.Resources>
<Grid Background="LightGray">
<Grid Background="LightGray">
<li:LoadingIndicator ZIndex="1" IsActive="{Binding IsBusy}" Mode="Arcs" SpeedRatio="1.2" Width="200" Height="200"/>
<DockPanel>
<Grid Margin="4">

View File

@@ -11,5 +11,78 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:DataType="vm:ScottPlotViewModel"
x:Class="PortfolioManager.Views.ScottPlotView">
<ScottPlot:AvaPlot Name="AvaPlot" Loaded="AvaPlot_Loaded"/>
<UserControl.Resources>
<local:CurrencyValueConverter x:Key="CurrencyFormat"/>
<local:DoubleValueConverter x:Key="DoubleFormat"/>
<local:IntValueConverter x:Key="IntFormat"/>
<local:DateValueConverter x:Key="DateFormat"/>
<local:RMultipleValueConverter x:Key="RMultipleFormat"/>
<local:BoolValueConverter x:Key="BoolFormat"/>
<local:OSValueConverter x:Key="OSValueConverter"/>
</UserControl.Resources>
<Grid Background="LightGray">
<li:LoadingIndicator ZIndex="1" IsActive="{Binding IsBusy}" Mode="Arcs" SpeedRatio="1.2" Width="200" Height="200"/>
<DockPanel>
<Grid Margin="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="6" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="3" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
<RowDefinition Height="89*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical">
<Label Content="Watch List" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=WatchListNames, Mode=OneWay}" SelectedItem="{Binding Path=SelectedWatchList}">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
<Label Content="Symbols" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=Symbols, Mode=OneWay}" SelectedItem="{Binding Path=SelectedSymbol}">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
<Label Content="Day Count" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=DayCounts, Mode=OneWay}" SelectedItem="{Binding Path=SelectedDayCount}"/>
<!-- <Button Content="Refresh" HorizontalAlignment="Stretch" Command="{Binding Path=Refresh}"></Button>
<CheckBox Content="Sync Trade To Band" IsChecked="{Binding Mode=TwoWay,Path=SyncTradeToBand}" HorizontalAlignment="Stretch" />
<CheckBox Content="Show Trade Labels" IsChecked="{Binding Mode=TwoWay,Path=ShowTradeLabels}" HorizontalAlignment="Stretch" />
<CheckBox Content="Show Insider Transactions" IsChecked="{Binding Mode=TwoWay,Path=CheckBoxShowInsiderTransactions}" HorizontalAlignment="Stretch" /> -->
</StackPanel>
</Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="3*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="24" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" FontSize="16" Text="{Binding Path=GraphTitle}" HorizontalAlignment="Center"></TextBlock>
<!-- <ScottPlot:AvaPlot Grid.Row="1" Name="AvaPlot" Loaded="AvaPlot_Loaded"/> -->
<ContentControl Grid.Row="1" Content="{Binding Path=Plotter}"/>
</Grid>
</Grid>
</DockPanel>
</Grid>
</UserControl>

View File

@@ -19,13 +19,14 @@ public partial class ScottPlotView : UserControl
private void AvaPlot_Loaded(object sender, RoutedEventArgs e)
{
// 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"));
}
}
// if (sender is ScottPlot.Avalonia.AvaPlot)
// {
// if (default == avaPlot)
// {
// PlotterWorkspaceViewModel viewModel = (DataContext as PlotterWorkspaceViewModel);
// avaPlot = this.Find<AvaPlot>("AvaPlot");
// viewModel.OnPlotterLoaded(avaPlot);
// }
// }
}
}