annotate MetroWpf/Stocks.UI/StocksView.xaml @ 21:dfc81f8bb838

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