239 lines
8.2 KiB
XML
239 lines
8.2 KiB
XML
<UserControl x:Class="TradeBlotter.Views.TradeEntryView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vw="clr-namespace:TradeBlotter.Views"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Width="419"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="480" d:DesignWidth="300">
|
|
<Grid Margin="4" Background="LightGray">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="6" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="30" />
|
|
<RowDefinition Height="Auto" />
|
|
|
|
|
|
</Grid.RowDefinitions>
|
|
<!-- TradeId -->
|
|
<Label
|
|
Grid.Row="0" Grid.Column="0"
|
|
Content="TradeId:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=tradeIdTxt}"
|
|
/>
|
|
<TextBox
|
|
x:Name="tradeIdTxt"
|
|
Grid.Row="0" Grid.Column="2"
|
|
Text="{Binding Path=TradeId, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="False" IsReadOnly="True" />
|
|
<!-- Trade Date-->
|
|
<Label
|
|
Grid.Row="1" Grid.Column="0"
|
|
Content="Trade Date:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=tradeDateLbl}"
|
|
/>
|
|
<DatePicker
|
|
Grid.Row="1" Grid.Column="2"
|
|
HorizontalAlignment="Left" Name="tradeDatePck"
|
|
SelectedDate="{Binding Path=TradeDate, ValidatesOnDataErrors=True}"
|
|
/>
|
|
<!-- Trade Type -->
|
|
<Label
|
|
Grid.Row="2" Grid.Column="0"
|
|
Content="Buy/Sell:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=tradeTypeCmb}"
|
|
/>
|
|
<ComboBox
|
|
x:Name="tradeTypeCmb"
|
|
Grid.Row="2" Grid.Column="2"
|
|
ItemsSource="{Binding Path=TradeTypeOptions, Mode=OneTime}"
|
|
SelectedItem="{Binding Path=SelectedTradeType, ValidatesOnDataErrors=True}"
|
|
Validation.ErrorTemplate="{x:Null}"
|
|
/>
|
|
<!-- TradeStatus -->
|
|
<Label
|
|
Grid.Row="3" Grid.Column="0"
|
|
Content="Status:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=tradeStatusCmb}"
|
|
/>
|
|
<TextBox
|
|
x:Name="tradeStatus"
|
|
Grid.Row="3" Grid.Column="2"
|
|
Text="{Binding Path=SelectedStatus, Mode=OneWay,ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="False" IsReadOnly="True" />
|
|
|
|
<Label
|
|
Grid.Row="4" Grid.Column="0"
|
|
Content="Symbol:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=symbolLabelTxt}"
|
|
/>
|
|
<TextBox
|
|
x:Name="symbolTxt"
|
|
Grid.Row="4" Grid.Column="2"
|
|
Text="{Binding Path=Symbol, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}" AcceptsReturn="True" />
|
|
<!-- Company-->
|
|
<Label
|
|
Grid.Row="5" Grid.Column="0"
|
|
Content="Company:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=companyNameLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="comanyNameTxt"
|
|
Grid.Row="5" Grid.Column="2"
|
|
Text="{Binding Path=CompanyName, ValidatesOnDataErrors=False, UpdateSourceTrigger=PropertyChanged}"
|
|
Validation.ErrorTemplate="{x:Null}" IsReadOnly="True" />
|
|
<!-- Shares-->
|
|
<Label
|
|
Grid.Row="6" Grid.Column="0"
|
|
Content="Shares:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=sharesLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="sharesTxt"
|
|
Grid.Row="6" Grid.Column="2"
|
|
Text="{Binding Path=Shares, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}"
|
|
Validation.ErrorTemplate="{x:Null}"
|
|
/>
|
|
<!-- Account-->
|
|
<Label
|
|
Grid.Row="7" Grid.Column="0"
|
|
Content="Account:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=accountLbl}"
|
|
/>
|
|
<ComboBox
|
|
x:Name="accountTxt"
|
|
Grid.Row="7" Grid.Column="2"
|
|
ItemsSource="{Binding Path=AccountOptions, Mode=OneTime}"
|
|
SelectedItem="{Binding Path=SelectedAccount, ValidatesOnDataErrors=True}"
|
|
/>
|
|
<!-- Price-->
|
|
<Label
|
|
Grid.Row="8" Grid.Column="0"
|
|
Content="Price:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=priceLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="priceTxt"
|
|
Grid.Row="8" Grid.Column="2"
|
|
Text="{Binding Path=Price, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}"
|
|
Validation.ErrorTemplate="{x:Null}"
|
|
/>
|
|
|
|
<!-- Stop Limit-->
|
|
<Label
|
|
Grid.Row="9" Grid.Column="0"
|
|
Content="Stop Limit:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=stopLimitLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="stopLimitTxt"
|
|
Grid.Row="9" Grid.Column="2"
|
|
Text="{Binding Path=StopLimit, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}"
|
|
Validation.ErrorTemplate="{x:Null}"
|
|
/>
|
|
|
|
<!-- Market Value-->
|
|
<Label
|
|
Grid.Row="10" Grid.Column="0"
|
|
Content="Exposure:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=exposureValueLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="exposureTxt"
|
|
Grid.Row="10" Grid.Column="2"
|
|
Text="{Binding Path=Exposure, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
|
|
Validation.ErrorTemplate="{x:Null}" IsReadOnly="True" />
|
|
<!-- Date Sold-->
|
|
<Label
|
|
Grid.Row="11" Grid.Column="0"
|
|
Content="Date Sold:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=sellDateValueLbl}"
|
|
/>
|
|
<DatePicker
|
|
Grid.Row="11" Grid.Column="2"
|
|
HorizontalAlignment="Left" Name="sellDatePck"
|
|
SelectedDate="{Binding Path=SellDate, ValidatesOnDataErrors=True}"
|
|
/>
|
|
<!-- Price Sold-->
|
|
<Label
|
|
Grid.Row="12" Grid.Column="0"
|
|
Content="Sell Price:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=sellPriceValueLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="sellPriceTxt"
|
|
Grid.Row="12" Grid.Column="2"
|
|
Text="{Binding Path=SellPrice, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}"
|
|
Validation.ErrorTemplate="{x:Null}" />
|
|
<!-- Commission-->
|
|
<Label
|
|
Grid.Row="13" Grid.Column="0"
|
|
Content="Commission:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=commissionValueLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="commissionTxt"
|
|
Grid.Row="13" Grid.Column="2"
|
|
Text="{Binding Path=Commission, ValidatesOnDataErrors=True, UpdateSourceTrigger=LostFocus}"
|
|
Validation.ErrorTemplate="{x:Null}" />
|
|
|
|
<!-- Available Cash-->
|
|
<Label
|
|
Grid.Row="14" Grid.Column="0"
|
|
Content="Available Cash:"
|
|
HorizontalAlignment="Right"
|
|
Target="{Binding ElementName=availableCashValueLbl}"
|
|
/>
|
|
<TextBox
|
|
x:Name="availableCashTxt"
|
|
Grid.Row="14" Grid.Column="2"
|
|
Text="{Binding Path=AvailableCash, Mode=OneWay}" IsReadOnly="True"
|
|
/>
|
|
|
|
<!-- SAVE BUTTON -->
|
|
<!--<StackPanel Grid.Row="14" Grid.Column="2" Orientation="Vertical">-->
|
|
<Button Grid.Row="15" Grid.Column="2" Command="{Binding Path=SaveCommand}" Content="_Save" HorizontalAlignment="Left" Margin="2,2" MinWidth="60" />
|
|
<TextBox Grid.Row="16" Grid.Column="2" x:Name="saveStatusTxt" Text="{Binding Path=Status, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Validation.ErrorTemplate="{x:Null}" IsReadOnly="True"/>
|
|
<!--</StackPanel>-->
|
|
</Grid>
|
|
</UserControl>
|