comparison MetroWpf/Stocks.UI/StocksView.xaml @ 20:6109bc268b90

Latest
author adminsh@apollo
date Tue, 20 Mar 2012 13:37:46 +0000
parents
children
comparison
equal deleted inserted replaced
19:09d18d6e5f40 20:6109bc268b90
1 <UserControl x:Class="Stocks.UI.StocksView"
2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6 xmlns:Converters="clr-namespace:Stocks.UI.Converters"
7 mc:Ignorable="d"
8 d:DesignHeight="100" d:DesignWidth="600"
9 d:DataContext="{Binding StocksViewModel, Source={StaticResource Locator}}">
10
11 <Grid x:Name="LayoutRoot">
12 <Grid.RowDefinitions>
13 <RowDefinition Height="60" />
14 <RowDefinition Height="20" />
15 <RowDefinition Height="280" />
16 <RowDefinition Height="180" />
17 </Grid.RowDefinitions>
18 <Grid.Resources>
19 <Converters:BoolToServiceRunningTextConverter x:Key="BoolToServiceRunningTextConverter" />
20 <Converters:BoolToSubscribedTextConverter x:Key="BoolToSubscribedTextConverter" />
21 <Converters:DeltaToIconConverter x:Key="DeltaToIconConverter" />
22 <Converters:AbsoluteNumberConverter x:Key="AbsoluteNumberConverter" />
23 <!--<Converters:DateTimeToTimeConverter x:Key="DateTimeToTimeConverter" />-->
24 </Grid.Resources>
25
26 <StackPanel Grid.Row="0" Orientation="Horizontal">
27 <Button x:Name="btnServiceRunning"
28 Width="100"
29 Height="30"
30 HorizontalAlignment="Left"
31 Content="{Binding Path=ServiceRunning, Converter={StaticResource BoolToServiceRunningTextConverter}}"
32 Command="{Binding Path=ServiceCommand, Mode=TwoWay}"
33 Margin="5,0,0,0"/>
34 <Button x:Name="btnSubscribe"
35 Width="100"
36 Height="30"
37 Margin="10,0,0,0"
38 HorizontalAlignment="Left"
39 Content="{Binding Path=Subscribed, Converter={StaticResource BoolToSubscribedTextConverter}}"
40 Command="{Binding Path=SubscriptionCommand, Mode=TwoWay}" />
41 </StackPanel>
42
43 <StackPanel Grid.Row="1" Orientation="Horizontal">
44 <TextBlock Text="Company" Width="170" Margin="5,0,0,0" />
45 <TextBlock Text="Price" Width="100" />
46 <TextBlock Text="Previous" Width="100" />
47 <TextBlock Text="Change" Width="105" />
48 <TextBlock Text="Time" Width="105" />
49 </StackPanel>
50 <ListBox x:Name="lbStockPrices"
51 ItemsSource="{Binding Path=DisplayStockPrices}"
52 BorderThickness="0" FontFamily="Segoe UI"
53 Grid.Row="2">
54 <ListBox.ItemTemplate>
55 <DataTemplate>
56 <StackPanel Orientation="Horizontal" Height="25">
57 <TextBlock Text="{Binding CompanyName}" Width="125" FontSize="15" Margin="10,0,0,0"/>
58 <TextBlock Text="{Binding Symbol}" Width="45" FontSize="15" Margin="10,0,0,0"/>
59 <TextBlock Text="{Binding CurrentPrice}" Width="100" FontSize="15" />
60 <TextBlock Text="{Binding PreviousPrice}" Width="100" FontSize="15" />
61 <Image Source="{Binding Delta, Converter={StaticResource DeltaToIconConverter}}" Width="20" />
62 <TextBlock Text="{Binding Delta, Converter={StaticResource AbsoluteNumberConverter}}" Width="85" FontSize="15" />
63 <!--<TextBlock Text="{Binding Timestamp, Converter={StaticResource DateTimeToTimeConverter}}" Width="100" FontSize="15" />-->
64 </StackPanel>
65 </DataTemplate>
66 </ListBox.ItemTemplate>
67 </ListBox>
68 </Grid>
69 </UserControl>