PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/V4/StockTrader RI/Silverlight/StockTraderRI.Modules.Position.Silverlight/Orders/OrderCompositeView.xaml

#
XAML | 48 lines | 48 code | 0 blank | 0 comment | 0 complexity | f90265c21c866ef36e81657bbef26ac5 MD5 | raw file
 1<UserControl x:Class="StockTraderRI.Modules.Position.Orders.OrderCompositeView"
 2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
 3    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 4    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit" 
 5    xmlns:Converters="clr-namespace:StockTraderRI.Infrastructure.Converters;assembly=StockTraderRI.Infrastructure"
 6    xmlns:orders="clr-namespace:StockTraderRI.Modules.Position.Orders">
 7    <UserControl.Resources>
 8        <Style x:Key="HeaderedContentControlStyle1" TargetType="toolkit:HeaderedContentControl">
 9            <Setter Property="Foreground" Value="#FF000000"/>
10            <Setter Property="HorizontalAlignment" Value="Stretch" />
11            <Setter Property="Template">
12                <Setter.Value>
13                    <ControlTemplate TargetType="toolkit:HeaderedContentControl">
14                        <StackPanel>
15                            <ContentPresenter Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/>
16                            <ContentPresenter Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
17                        </StackPanel>
18                    </ControlTemplate>
19                </Setter.Value>
20            </Setter>
21        </Style>
22        <Converters:TransactionTypeToStringConverter x:Key="transactionTypeToStringConverter" />
23    </UserControl.Resources>
24    <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
25        <Border Padding="5,5,5,5" BorderBrush="#77000000" BorderThickness="1,1,1,1" Margin="0,0,0,10" CornerRadius="12,12,12,12">
26            <toolkit:HeaderedContentControl x:Name="HeaderedControl" BorderThickness="2,1,2,1" Style="{StaticResource HeaderedContentControlStyle1}" Content="{Binding OrderDetails}">
27                <ContentControl.ContentTemplate>
28                    <DataTemplate>
29                        <orders:OrderDetailsView/>
30                    </DataTemplate>
31                </ContentControl.ContentTemplate>
32                <toolkit:HeaderedContentControl.Header>
33                    <Grid>
34                        <Grid.ColumnDefinitions>
35                            <ColumnDefinition Width="*" />
36                            <ColumnDefinition Width="1.5*" />
37                        </Grid.ColumnDefinitions>
38                        <StackPanel Grid.Row="0" Grid.Column="0" Margin="10,0,0,12" Orientation="Horizontal">
39                            <TextBlock Text="{Binding Converter={StaticResource transactionTypeToStringConverter}, Path=TransactionInfo.TransactionType}" Style="{StaticResource TextBlockSectionTitle}" />
40                            <TextBlock Text="{Binding HeaderInfo}" Style="{StaticResource TextBlockSectionTitle}" />
41                        </StackPanel>
42                        <orders:OrderCommandsView Grid.Column="1" HorizontalAlignment="Right" DataContext="{Binding OrderDetails}"/>
43                    </Grid>
44                </toolkit:HeaderedContentControl.Header>
45            </toolkit:HeaderedContentControl>
46        </Border>
47    </Grid>
48</UserControl>