| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <Window x:Class="Muchinfo.MTPClient.Account.Views.TradeParamSetView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:converters="clr-namespace:Muchinfo.MTPClient.Infrastructure.Converters;assembly=Client.Infrastructure"
- xmlns:dataGrid="clr-namespace:Muchinfo.WPF.Controls.DataGrid;assembly=Client.WPF.Controls"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- xmlns:resource="clr-namespace:Muchinfo.MTPClient.Resources;assembly=Client.Resources"
- x:Name="openOrderWindow"
- Width="500"
- Height="400"
- ShowInTaskbar="False"
- Style="{DynamicResource TradeDialogWindowStyle}"
- WindowStartupLocation="CenterOwner">
- <Window.Resources>
- <converters:EnumVisibilityConvert x:Key="EnumVisibilityConvert" />
- <Style TargetType="TextBlock">
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
- </Window.Resources>
- <!-- 总算知道为什么xaml里,看到的界面都是重叠,乱的,因为动态绑定的问题,界面就是这调用的 -->
- <Grid>
- <!-- 交易参数设置 -->
- <Grid Margin="10,20" Visibility="{Binding SettingTadIndex, Converter={StaticResource EnumVisibilityConvert}, ConverterParameter=0}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="170" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock Text="{x:Static resource:Client_Resource.Content_IsOrderComfrim}" />
- <TextBlock Grid.Row="1" Text="{x:Static resource:Client_Resource.Content_SuccessCloseWin}" />
- <TextBlock Grid.Row="2" Text="{x:Static resource:Client_Resource.Content_CancelComfrim}" />
- <TextBlock Grid.Row="3" Text="{x:Static resource:Client_Resource.Content_LockScreenTime}" />
- <ComboBox Grid.Column="1"
- Width="200"
- Margin="20,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- DisplayMemberPath="Value"
- ItemsSource="{Binding OrderComfrimItems}"
- SelectedValue="{Binding TradeParams.IsOrderComfrim,
- Mode=TwoWay}"
- SelectedValuePath="Key"
- Style="{DynamicResource SimpleComboBoxStyle}"
- TabIndex="1" />
- <ComboBox Grid.Row="1"
- Grid.Column="1"
- Width="200"
- Margin="20,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- DisplayMemberPath="Value"
- ItemsSource="{Binding SuccessItems}"
- SelectedValue="{Binding TradeParams.IsSuccessComfrim,
- Mode=TwoWay}"
- SelectedValuePath="Key"
- Style="{DynamicResource SimpleComboBoxStyle}"
- TabIndex="2" />
- <ComboBox Grid.Row="2"
- Grid.Column="1"
- Width="200"
- Margin="20,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- DisplayMemberPath="Value"
- ItemsSource="{Binding CancelItems}"
- SelectedValue="{Binding TradeParams.IsCancelComfrim,
- Mode=TwoWay}"
- SelectedValuePath="Key"
- Style="{DynamicResource SimpleComboBoxStyle}"
- TabIndex="3" />
- <ComboBox Grid.Row="3"
- Grid.Column="1"
- Width="200"
- Margin="20,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- DisplayMemberPath="Value"
- ItemsSource="{Binding LockScreenItems}"
- SelectedValue="{Binding TradeParams.LockScreenTime,
- Mode=TwoWay}"
- SelectedValuePath="Key"
- Style="{DynamicResource SimpleComboBoxStyle}"
- TabIndex="4" />
- <StackPanel Grid.Row="4"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Center"
- Orientation="Horizontal">
- <Button Width="82"
- Height="26"
- Command="{Binding OKCommand}"
- CommandParameter="{Binding ElementName=openOrderWindow}"
- Content="{x:Static resource:Client_Resource.Button_Confirm}"
- IsDefault="True"
- IsEnabled="{Binding OKButtonEnabled}"
- Style="{DynamicResource CommonButtonStyle}"
- TabIndex="5" />
- <Button Width="82"
- Height="26"
- Margin="60,0,0,0"
- Command="{Binding CancelCommand}"
- CommandParameter="{Binding ElementName=openOrderWindow}"
- Content="{x:Static resource:Client_Resource.Button_Cancel}"
- Style="{DynamicResource CommonButtonStyle}"
- TabIndex="6" />
- </StackPanel>
- </Grid>
- <!-- 自动指引止损 -->
- <Grid x:Name="AutoEntrust" Visibility="{Binding SettingTadIndex, Converter={StaticResource EnumVisibilityConvert}, ConverterParameter=1}">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="50" />
- </Grid.RowDefinitions>
- <TextBlock x:Name="AutoEntrustTips"
- Grid.ColumnSpan="4"
- Margin="15,0,0,0"
- HorizontalAlignment="Left"
- Background="Transparent"
- Foreground="White"
- Text="开仓后,在成交价基础上按设置的调整价位止盈止损,0代表不使用此功能。"
- TextWrapping="Wrap" />
- <!-- 商品列表咯 -->
- <dataGrid:MuchinfoDataGrid Grid.Row="1"
- Height="250"
- Margin="15,0,15,0"
- BorderBrush="#666666"
- BorderThickness="1"
- ItemsSource="{Binding AllGoodsForAutoEntrustModel}"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden"
- ScrollViewer.VerticalScrollBarVisibility="Hidden"
- SelectedItem="{Binding CurrentGoodsForAutoEntrustModel}"
- SelectionMode="Single"
- Style="{DynamicResource AutoEntrustDataGridStyle}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="MouseLeftButtonDown">
- <i:InvokeCommandAction Command="{Binding SelectItemCommand}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <DataGrid.Columns>
- <!-- 商品/代码 -->
- <DataGridTextColumn Width="Auto"
- MinWidth="180"
- ElementStyle="{StaticResource DataGridTextColumnStyle}"
- Header="{x:Static resource:Client_Resource.Content_Goods}"
- SortMemberPath="GoodsCode">
- <DataGridTextColumn.Binding>
- <MultiBinding StringFormat="{}{0} {1}">
- <Binding Path="GoodsName" />
- <Binding Path="GoodsCode" />
- </MultiBinding>
- </DataGridTextColumn.Binding>
- </DataGridTextColumn>
- <!-- 方向 -->
- <DataGridTextColumn Width="Auto"
- MinWidth="50"
- Binding="{Binding DirectionString}"
- ElementStyle="{StaticResource DataGridTextColumnStyleLeft}"
- Header="{x:Static resource:Client_Resource.Content_Direction}" />
- <!-- 止损 -->
- <DataGridTemplateColumn Width="Auto" MinWidth="100">
- <DataGridTemplateColumn.Header>
- <TextBlock Text="{x:Static resource:Client_Resource.Trade_Content_SlStrategy}" />
- </DataGridTemplateColumn.Header>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBox Width="80"
- Height="30"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- Background="Black"
- BorderBrush="#666666"
- BorderThickness="1"
- Foreground="White"
- Padding="1"
- Text="{Binding Loss}"
- TextChanged="TextBoxBase_SL_OnTextChanged" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- <!-- 止盈 -->
- <DataGridTemplateColumn Width="Auto" MinWidth="100">
- <DataGridTemplateColumn.Header>
- <TextBlock Text="{x:Static resource:Client_Resource.Trade_Content_SpStrategy}" />
- </DataGridTemplateColumn.Header>
- <DataGridTemplateColumn.CellTemplate>
- <DataTemplate>
- <TextBox Width="80"
- Height="30"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Center"
- Background="Black"
- BorderBrush="#666666"
- BorderThickness="1"
- Foreground="White"
- Padding="1"
- Text="{Binding Profit}"
- TextChanged="TextBoxBase_SP_OnTextChanged" />
- </DataTemplate>
- </DataGridTemplateColumn.CellTemplate>
- </DataGridTemplateColumn>
- </DataGrid.Columns>
- </dataGrid:MuchinfoDataGrid>
- <StackPanel Grid.Row="2"
- HorizontalAlignment="Center"
- Orientation="Horizontal">
- <Button Width="82"
- Height="26"
- Command="{Binding SetAutoCommand}"
- CommandParameter="{Binding ElementName=openOrderWindow}"
- Content="{x:Static resource:Client_Resource.Button_Update}"
- IsDefault="True"
- Style="{DynamicResource CommonButtonStyle}" />
- <Button Width="82"
- Height="26"
- Margin="50,0,0,0"
- Command="{Binding ResetCommand}"
- CommandParameter="{Binding ElementName=openOrderWindow}"
- Content="{x:Static resource:Client_Resource.All_Reset}"
- IsDefault="True"
- Style="{DynamicResource CommonButtonStyle}" />
- <Button Width="82"
- Height="26"
- Margin="50,0,0,0"
- Command="{Binding CancelCommand}"
- CommandParameter="{Binding ElementName=openOrderWindow}"
- Content="{x:Static resource:Client_Resource.Button_Cancel}"
- Style="{DynamicResource CommonButtonStyle}" />
- </StackPanel>
- </Grid>
- </Grid>
- </Window>
|