Files
TradeBlotter/Views/ResistanceAndSupportView.xaml
2024-02-23 06:58:53 -05:00

68 lines
4.6 KiB
XML

<UserControl x:Class="TradeBlotter.Views.ResistanceAndSupportView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
xmlns:dc="clr-namespace:TradeBlotter.UIUtils"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:wpfx="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<wpfx:BusyIndicator Name="BusyBar" IsBusy="{Binding Path=BusyIndicator}" BusyContent="{Binding Path=BusyContent}">
<Grid Background="LightGray">
<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" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Orientation="Vertical">
<Label Content="Watch List" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=WatchListNames, Mode=OneTime}" SelectedItem="{Binding Path=SelectedWatchList, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" ></ComboBox>
<!--<Label Content="Symbol" HorizontalAlignment="Left" Target="{Binding ElementName=tradeDateLbl}" ></Label>-->
<Label Content="Symbol" HorizontalAlignment="Left" ></Label>
<ComboBox ItemsSource="{Binding Path=Symbols, Mode=OneWay}" SelectedItem="{Binding Path=SelectedSymbol, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" >
<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, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" ></ComboBox>
<Button Margin="0,2" Content="Refresh" HorizontalAlignment="Left" Command="{Binding Path=RefreshCommand}"></Button>
<CheckBox Margin="0,2" Content="Legend Visible" HorizontalAlignment="Left" IsChecked="{Binding Path=CheckBoxLegendVisible, Mode=TwoWay}"></CheckBox>
</StackPanel>
</Grid>
<d3:ChartPlotter Background="WhiteSmoke" Name="resistanceandsupport" Margin="10,10,20,10" LegendVisibility="Hidden" dc:ChartPlotterLegendBehavior.LegendVisibleProperty="{Binding Path=LegendVisible}" d3:Viewport2D.UsesApproximateContentBoundsComparison="False" BorderThickness="0">
<d3:ChartPlotter.MainHorizontalAxis>
<d3:HorizontalDateTimeAxis Name="dateAxis"/>
</d3:ChartPlotter.MainHorizontalAxis>
<d3:ChartPlotter.MainVerticalAxis>
<d3:VerticalAxis Name="countAxis"/>
</d3:ChartPlotter.MainVerticalAxis>
<d3:LineGraph d3:NewLegend.Description="R1" x:Name="R1" DataSource="{Binding Path=R1}" Stroke="Green" StrokeThickness="3"/>
<d3:LineGraph d3:NewLegend.Description="S1" x:Name="S1" DataSource="{Binding Path=S1}" Stroke="Green" StrokeThickness="3"/>
<d3:LineGraph d3:NewLegend.Description="R2" x:Name="R2" DataSource="{Binding Path=R2}" Stroke="Green" StrokeThickness="4"/>
<d3:LineGraph d3:NewLegend.Description="S2" x:Name="S2" DataSource="{Binding Path=S2}" Stroke="Green" StrokeThickness="4"/>
<d3:LineGraph d3:NewLegend.Description="High" x:Name="High" DataSource="{Binding Path=High}" Stroke="Blue" StrokeThickness="1"/>
<d3:LineGraph d3:NewLegend.Description="Low" x:Name="Low" DataSource="{Binding Path=Low}" Stroke="Red" StrokeThickness="1"/>
<d3:LineGraph d3:NewLegend.Description="Close" x:Name="Close" DataSource="{Binding Path=Close}" Stroke="Black" StrokeThickness="1"/>
<d3:CursorCoordinateGraph Name="cursorGraph" dc:CoordinateGraphBehavior.XTextMappingProperty="MM/dd/yyyy" LineStrokeThickness="1"/>
<!--<d3:AxisCursorGraph></d3:AxisCursorGraph>-->
<d3:Header FontFamily="Arial" Content="{Binding Path=Title}"/>
<d3:VerticalAxisTitle FontFamily="Arial" Content="Price"/>
<d3:HorizontalAxisTitle FontFamily="Arial" Content="Date" />
</d3:ChartPlotter>
</DockPanel>
</Grid>
</wpfx:BusyIndicator>
</UserControl>