| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404 |
- <Window x:Class="MuchInfo.Chart.App.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:ct="clr-namespace:MuchInfo.Chart.App.Converters"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:mi="clr-namespace:MuchInfo.Chart.WPF;assembly=MuchInfo.Chart.WPF"
- xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
- Title="图表控件测试App (v1.0.0.2)"
- Background="White"
- DataContext="{Binding Main,
- Source={StaticResource Locator}}"
- WindowState="Maximized"
- mc:Ignorable="d">
- <Window.Resources>
- <ct:ColorConverter x:Key="colorConverter" />
- <ct:LanguageConverter x:Key="languageConverter" />
- <ct:ComparisonGoodsCommandConverter x:Key="comparisonGoodsCommandConverter" />
- </Window.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <GroupBox Grid.Column="0"
- Margin="3"
- Header="图表属性设置"
- Padding="5">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="10" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <TextBlock Grid.Row="0"
- Grid.Column="0"
- Text="语言环境:" />
- <ComboBox Grid.Row="0"
- Grid.Column="2"
- DisplayMemberPath="Value"
- ItemsSource="{Binding Languages}"
- SelectedItem="{Binding ChartLanguage,
- Mode=TwoWay,
- Converter={StaticResource languageConverter}}"
- SelectedValuePath="Key" />
- <TextBlock Grid.Row="1"
- Grid.Column="0"
- Text="图表背景色:" />
- <xctk:ColorPicker Grid.Row="1"
- Grid.Column="2"
- Width="100"
- SelectedColor="{Binding ChartBackground,
- Mode=TwoWay,
- Converter={StaticResource colorConverter}}"
- ShowAdvancedButton="True"
- ShowAvailableColors="True"
- ShowDropDownButton="True"
- ShowStandardColors="True"
- UsingAlphaChannel="True" />
- <TextBlock Grid.Row="2"
- Grid.Column="0"
- Text="图表字体大小:" />
- <xctk:SingleUpDown Grid.Row="2"
- Grid.Column="2"
- Width="100"
- Increment="1"
- Maximum="72"
- Minimum="12"
- Value="{Binding ChartFontSize,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="3"
- Grid.Column="0"
- Text="网格透明度:" />
- <xctk:DoubleUpDown Grid.Row="3"
- Grid.Column="2"
- AllowInputSpecialValues="Any"
- AllowSpin="True"
- ClipValueToMinMax="True"
- CultureInfo="zh-cn"
- FormatString="P0"
- Increment="0.01"
- IsReadOnly="False"
- Maximum="1"
- Minimum="0"
- MouseWheelActiveOnFocus="True"
- ParsingNumberStyle="Any"
- ShowButtonSpinner="True"
- Value="{Binding GridOpacity,
- Mode=TwoWay}" />
- <!--
- <TextBlock Grid.Row="4"
- Grid.Column="0"
- Text="图表头显示" />
- <ComboBox Grid.Row="4"
- Grid.Column="2"
- ItemsSource="{Binding Visibilities}"
- SelectedItem="{Binding ShowHeader,
- Mode=TwoWay}" />
- -->
- <TextBlock Grid.Row="5"
- Grid.Column="0"
- Text="画图工具显示" />
- <ComboBox Grid.Row="5"
- Grid.Column="2"
- ItemsSource="{Binding Visibilities}"
- SelectedItem="{Binding ShowDrawingTool,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="6"
- Grid.Column="0"
- Text="画图工具位置" />
- <ComboBox Grid.Row="6"
- Grid.Column="2"
- ItemsSource="{Binding DrawingToolPositions}"
- SelectedItem="{Binding DrawingToolPosition,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="7"
- Grid.Column="0"
- Text="当前画图工具" />
- <ComboBox Grid.Row="7"
- Grid.Column="2"
- ItemsSource="{Binding DrawingToolTypes}"
- SelectedItem="{Binding DrawingToolType,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="8"
- Grid.Column="0"
- Text="最大显示数据"
- ToolTip="滑块能拖动到的最大数据条数" />
- <xctk:IntegerUpDown Grid.Row="8"
- Grid.Column="2"
- AllowSpin="True"
- ClipValueToMinMax="True"
- Increment="1"
- IsReadOnly="False"
- Maximum="10000"
- Minimum="0"
- MouseWheelActiveOnFocus="True"
- ParsingNumberStyle="Any"
- ShowButtonSpinner="True"
- Value="{Binding MaxRecordCount,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="9"
- Grid.Column="0"
- Text="最小显示数据"
- ToolTip="滑块能拖动到的最小数据条数" />
- <xctk:IntegerUpDown Grid.Row="9"
- Grid.Column="2"
- AllowSpin="True"
- ClipValueToMinMax="True"
- FormatString="N0"
- Increment="1"
- IsReadOnly="False"
- Maximum="10000"
- Minimum="0"
- MouseWheelActiveOnFocus="True"
- ParsingNumberStyle="Any"
- ShowButtonSpinner="True"
- ToolTip="滑块能拖动到的最小数据条数"
- Value="{Binding MinRecordCount,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="10"
- Grid.Column="0"
- Text="默认数据"
- ToolTip="加载数据时默认数据条数" />
- <xctk:IntegerUpDown Grid.Row="10"
- Grid.Column="2"
- AllowSpin="True"
- ClipValueToMinMax="True"
- FormatString="N0"
- Increment="1"
- IsReadOnly="False"
- Maximum="10000"
- Minimum="0"
- MouseWheelActiveOnFocus="True"
- ParsingNumberStyle="Any"
- ShowButtonSpinner="True"
- Value="{Binding RecordCount,
- Mode=TwoWay}" />
- <!--
- <TextBlock Grid.Row="11"
- Grid.Column="0"
- Text="主图类型" />
- <ComboBox Grid.Row="11"
- Grid.Column="2"
- ItemsSource="{Binding LinePlotTypes}"
- SelectedItem="{Binding LinePlotType,
- Mode=TwoWay}" />
- -->
- <!--
- <TextBlock Grid.Row="12"
- Grid.Column="0"
- Text="添加指标图"
- ToolTip="目前只有Price,Volume" />
- <ComboBox Grid.Row="12"
- Grid.Column="2"
- ItemsSource="{Binding IndicatorTypes}"
- SelectedValue="{Binding IndicatorType,
- Mode=TwoWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectionChanged">
- <i:InvokeCommandAction Command="{Binding AddIndicatorCommand}" CommandParameter="{Binding ElementName=NewChart}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ComboBox>
- -->
- <TextBlock Grid.Row="13"
- Grid.Column="0"
- Text="数据周期" />
- <ComboBox Grid.Row="13"
- Grid.Column="2"
- ItemsSource="{Binding CycleTypes}"
- SelectedValue="{Binding CycleType,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="14"
- Grid.Column="0"
- Text="加速滚动快捷键" />
- <ComboBox Grid.Row="14"
- Grid.Column="2"
- ItemsSource="{Binding ModifierKeys}"
- SelectedValue="{Binding AcceleratedWheelModifierKeys,
- Mode=TwoWay}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectionChanged">
- <i:InvokeCommandAction Command="{Binding CycleTypeChangedCommand}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ComboBox>
- <TextBlock Grid.Row="15"
- Grid.Column="0"
- Text="加速滚动倍数" />
- <xctk:IntegerUpDown Grid.Row="15"
- Grid.Column="2"
- AllowSpin="True"
- ClipValueToMinMax="True"
- FormatString="N0"
- Increment="1"
- IsReadOnly="False"
- Maximum="1000"
- Minimum="1"
- MouseWheelActiveOnFocus="True"
- ParsingNumberStyle="Any"
- ShowButtonSpinner="True"
- Value="{Binding AcceleratedWheelFactor,
- Mode=TwoWay}" />
- <TextBlock Grid.Row="16"
- Grid.Column="0"
- Text="商品代码" />
- <ComboBox x:Name="GoodsComboBox"
- Grid.Row="16"
- Grid.Column="2"
- DisplayMemberPath="Symbol"
- ItemsSource="{Binding GoodsInfos}"
- SelectedItem="{Binding GoodsInfo,
- Mode=TwoWay}"
- SelectedValuePath="Symbol" />
- <GroupBox Grid.Row="17"
- Grid.Column="0"
- Header="商品叠加:">
- <ListBox x:Name="ComparisonGoodsListBox"
- DisplayMemberPath="Symbol"
- ItemsSource="{Binding ComparisonGoodsList}"
- SelectionMode="Single">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectionChanged">
- <i:InvokeCommandAction Command="{Binding ComparisonGoodsCommand}">
- <i:InvokeCommandAction.CommandParameter>
- <MultiBinding Converter="{StaticResource comparisonGoodsCommandConverter}">
- <Binding ElementName="NewChart" />
- <Binding ElementName="ComparisonGoodsListBox" />
- </MultiBinding>
- </i:InvokeCommandAction.CommandParameter>
- </i:InvokeCommandAction>
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ListBox>
- </GroupBox>
- <Button Grid.Row="17"
- Grid.Column="2"
- Command="{Binding CancelComparisonGoodsCommand}"
- CommandParameter="{Binding ElementName=NewChart}"
- Content="取消叠加" />
- <TextBlock Grid.Row="18"
- Grid.Column="0"
- Text="叠加蜡烛图是否填充" />
- <ComboBox x:Name="FillComparisonCandleComboBox"
- Grid.Row="18"
- Grid.Column="2"
- DisplayMemberPath="Key"
- ItemsSource="{Binding BoolDictionary}"
- SelectedItem="{Binding FillComparisonCandle,
- Mode=TwoWay}"
- SelectedValuePath="Value" />
- <TextBlock Grid.Row="19"
- Grid.Column="0"
- Text="加载数据条数"
- ToolTip="最大加载数据条数" />
- <xctk:IntegerUpDown Grid.Row="19"
- Grid.Column="2"
- AllowSpin="True"
- ClipValueToMinMax="True"
- FormatString="N0"
- Increment="1"
- IsReadOnly="False"
- Maximum="10000"
- Minimum="0"
- MouseWheelActiveOnFocus="True"
- ParsingNumberStyle="Any"
- ShowButtonSpinner="True"
- ToolTip="最大加载数据条数"
- Value="{Binding MaxLoadRecordCount,
- Mode=TwoWay}" />
- <Button x:Name="btnOpen"
- Grid.Row="20"
- Click="BtnOpen_OnClick"
- Content="编辑公式" />
- <Button x:Name="btnadd"
- Grid.Row="20"
- Grid.Column="2"
- Command="{Binding AddIndicatorCommand}"
- CommandParameter="{Binding ElementName=NewChart}"
- Content="添加指标" />
- <Button Grid.Row="21"
- Grid.Column="0"
- Command="{Binding ExportToExcel}"
- CommandParameter="{Binding ElementName=NewChart}"
- Content="导出数据到Excel" />
- </Grid>
- </GroupBox>
- <mi:Chart x:Name="NewChart"
- Grid.Column="1"
- AcceleratedWheelFactor="{Binding AcceleratedWheelFactor}"
- AcceleratedWheelModifierKeys="{Binding AcceleratedWheelModifierKeys}"
- ChartBackground="{Binding ChartBackground}"
- ChartFontSize="{Binding ChartFontSize}"
- ChartLanguage="{Binding ChartLanguage}"
- CurrentGoods="{Binding GoodsInfo}"
- CurrentTik="{Binding TikBarDataPoint}"
- CycleItems="{Binding CycleItems,
- Mode=TwoWay}"
- CycleType="{Binding CycleType,
- Mode=TwoWay}"
- DrawingToolIsEnabled="True"
- DrawingToolPosition="{Binding DrawingToolPosition}"
- DrawingToolType="{Binding DrawingToolType}"
- FillComparisonCandle="{Binding FillComparisonCandle.Value}"
- GridOpacity="{Binding GridOpacity}"
- LeftRightKeyToAcceleration="20"
- LinePlotType="{Binding LinePlotType}"
- MaxLoadRecordCount="{Binding MaxLoadRecordCount}"
- MaxRecordCount="{Binding MaxRecordCount}"
- MinRecordCount="{Binding MinRecordCount}"
- RecordCount="{Binding RecordCount}"
- RightBuffer="25"
- ShowDrawingTool="Visible" />
- </Grid>
- </Window>
|