PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/V2.2/trunk/RI/Silverlight/StockTraderRI.Modules.Position.Silverlight/Orders/OrderDetailsView.xaml

#
XAML | 45 lines | 37 code | 5 blank | 3 comment | 0 complexity | 6f0ae416fc77d50723aa90d7a260fefa MD5 | raw file
 1<UserControl
 2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 3    xmlns:infConverters="clr-namespace:StockTraderRI.Infrastructure.Converters;assembly=StockTraderRI.Infrastructure"
 4    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 5    xmlns:inf="clr-namespace:StockTraderRI.Infrastructure;assembly=StockTraderRI.Infrastructure" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="StockTraderRI.Modules.Position.Orders.OrderDetailsView"
 6    mc:Ignorable="d" d:DesignWidth="964" d:DesignHeight="100.108" Margin="0,0,0,0" AutomationProperties.AutomationId="PositionBuySellTab" >
 7    <UserControl.Resources>
 8        <infConverters:EnumToBooleanConverter x:Key="enumToBooleanConverter" />
 9        <infConverters:StringToNullableNumberConverter x:Key="stringToNullableNumberConverter" />
10    </UserControl.Resources>
11
12    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0">
13        <Grid.RowDefinitions>
14            <RowDefinition Height="55" />
15            <RowDefinition Height="45" />
16        </Grid.RowDefinitions>
17        <Grid.ColumnDefinitions>
18            <ColumnDefinition Width="100" />
19            <ColumnDefinition Width="130" />
20            <ColumnDefinition Width="80" />
21            <ColumnDefinition Width="130" />
22            <ColumnDefinition Width="80" />
23            <ColumnDefinition Width="Auto" MinWidth="321" />
24        </Grid.ColumnDefinitions>
25        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
26            <RadioButton Content="Buy" AutomationProperties.AutomationId="BuyRadioButton" Background="{x:Null}" BorderBrush="{x:Null}" Height="Auto" Width="Auto" Margin="0,0,15,0" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="{Binding Converter={StaticResource enumToBooleanConverter}, ConverterParameter=Buy, Mode=TwoWay, Path=TransactionType}" Style="{StaticResource CustomRadioCheckbox}" Foreground="#FF444444"/>
27            <RadioButton Content="Sell" AutomationProperties.AutomationId="SellRadioButton" Background="{x:Null}" BorderBrush="{x:Null}" Height="Auto" Width="Auto" Margin="15,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" IsChecked="{Binding Converter={StaticResource enumToBooleanConverter}, ConverterParameter=Sell, Mode=TwoWay, Path=TransactionType}"  Style="{StaticResource CustomRadioCheckbox}" Foreground="#FF444444"/>
28        </StackPanel>
29
30        <TextBlock Grid.Row="0" Grid.Column="2" Text="Shares:" Foreground="#FF444444" VerticalAlignment="Center" Width="Auto" Height="Auto" HorizontalAlignment="Right" Grid.ColumnSpan="1" Margin="0,0,0,0" />
31        <!-- NOTE: The following is using validation based on model binding exceptions, using the help 
32                   of attached properties to avoid using code-behind. There might be better ways of doing
33                   this and it should not be taken as guidance on how to perform validation. -->
34        <TextBox Grid.Row="0" Grid.Column="3" AutomationProperties.AutomationId="SharesTextBox" inf:OnValidationError.ShowToolTip="True" inf:OnValidationError.ToggleBackground="Red" Text="{Binding Converter={StaticResource stringToNullableNumberConverter}, Mode=TwoWay, NotifyOnValidationError=True, Path=Shares, ValidatesOnExceptions=True}" HorizontalAlignment="Stretch" Width="120" Height="Auto" VerticalAlignment="Center" Margin="0,0,0,0" Style="{StaticResource CustomTextBox}" />
35
36        <TextBlock Grid.Row="0" Grid.Column="4" Text="Price Limit:" Foreground="#FF444444" HorizontalAlignment="Right" VerticalAlignment="Center" Width="Auto" Height="Auto" Margin="0,0,0,0" />
37        <TextBox Grid.Row="0" Grid.Column="5" HorizontalAlignment="Left" Width="120" Height="Auto" VerticalAlignment="Center" Margin="5,0,0,0" inf:OnValidationError.ShowToolTip="True" inf:OnValidationError.ToggleBackground="Red" Text="{Binding Converter={StaticResource stringToNullableNumberConverter}, Mode=TwoWay, NotifyOnValidationError=True, Path=StopLimitPrice, ValidatesOnExceptions=True}" AutomationProperties.AutomationId="PriceLimitTextBox" Style="{StaticResource CustomTextBox}" />
38
39        <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" Width="Auto" Height="Auto" Text="Order Type:" Foreground="#FF444444" VerticalAlignment="Center" />
40        <ComboBox   Style="{StaticResource CustomComboBox}"  Grid.Row="1" Grid.Column="1" AutomationProperties.AutomationId="OrderTypeComboBox" Width="120" Height="Auto" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="0,0,0,0" ItemsSource="{Binding Path=AvailableOrderTypes}" inf:SelectorExtensions.SelectedValue="{Binding Mode=TwoWay, Path=OrderType}" inf:SelectorExtensions.SelectedValuePath="Value" />
41
42        <TextBlock Grid.Row="1" Grid.Column="2" Text="Term:" Foreground="#FF444444" HorizontalAlignment="Right" VerticalAlignment="Center" Width="Auto" Height="Auto" Margin="0,0,0,0" />
43        <ComboBox   Style="{StaticResource CustomComboBox}" AutomationProperties.AutomationId="TermComboBox" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Stretch" Width="120" Height="Auto" VerticalAlignment="Center" Margin="0,0,0,0" ItemsSource="{Binding Path=AvailableTimesInForce}" inf:SelectorExtensions.SelectedValue="{Binding Mode=TwoWay, Path=TimeInForce}" inf:SelectorExtensions.SelectedValuePath="Value" />
44    </Grid>
45</UserControl>