PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/V2/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. <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0">
  12. <Grid.RowDefinitions>
  13. <RowDefinition Height="55" />
  14. <RowDefinition Height="45" />
  15. </Grid.RowDefinitions>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="100" />
  18. <ColumnDefinition Width="130" />
  19. <ColumnDefinition Width="80" />
  20. <ColumnDefinition Width="130" />
  21. <ColumnDefinition Width="80" />
  22. <ColumnDefinition Width="Auto" MinWidth="321" />
  23. </Grid.ColumnDefinitions>
  24. <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  25. <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"/>
  26. <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"/>
  27. </StackPanel>
  28. <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" />
  29. <!-- NOTE: The following is using validation based on model binding exceptions, using the help
  30. of attached properties to avoid using code-behind. There might be better ways of doing
  31. this and it should not be taken as guidance on how to perform validation. -->
  32. <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}" />
  33. <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" />
  34. <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}" />
  35. <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" Width="Auto" Height="Auto" Text="Order Type:" Foreground="#FF444444" VerticalAlignment="Center" />
  36. <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" />
  37. <TextBlock Grid.Row="1" Grid.Column="2" Text="Term:" Foreground="#FF444444" HorizontalAlignment="Right" VerticalAlignment="Center" Width="Auto" Height="Auto" Margin="0,0,0,0" />
  38. <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" />
  39. </Grid>
  40. </UserControl>