PageRenderTime 15ms CodeModel.GetById 13ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/V2.2/trunk/RI/Desktop/StockTraderRI.Modules.WatchList/WatchList/WatchListView.xaml

#
XAML | 38 lines | 38 code | 0 blank | 0 comment | 0 complexity | 42eef3de37fd95dc66ab2089464a90d0 MD5 | raw file
 1<UserControl x:Class="StockTraderRI.Modules.Watch.WatchList.WatchListView"
 2    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 3    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 4    xmlns:Converters="clr-namespace:StockTraderRI.Infrastructure.Converters;assembly=StockTraderRI.Infrastructure"
 5    Height="Auto" Width="Auto">
 6    <UserControl.Resources>
 7        <Converters:CurrencyConverter x:Key="currencyConverter" />
 8        <Style x:Key="PathMouseOverStyle" TargetType="{x:Type Path}">
 9            <Setter Property="Fill" Value="#FF77B6EB"/>
10            <Style.Triggers>
11                <Trigger Property="IsMouseOver" Value="True">
12                    <Setter Property="Fill" Value="#7F77B6EB"/>
13                </Trigger>
14            </Style.Triggers>
15        </Style>
16    </UserControl.Resources>
17    <StackPanel>
18        <ListView Name="watchListListView" 
19                  ItemsSource="{Binding WatchListItems}" SelectedItem="{Binding Mode=TwoWay, Path=CurrentWatchItem}"
20                  AlternationCount="2"
21                  BorderThickness="0" Width="Auto"
22                  IsSynchronizedWithCurrentItem="True" AutomationProperties.AutomationId="WatchListGrid" >
23            <ListView.View>
24                <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Watch List" >
25                    <GridViewColumn Header="Symbol" DisplayMemberBinding="{Binding Path=TickerSymbol}" Width="65"/>
26                    <GridViewColumn Header="Last"  DisplayMemberBinding="{Binding Converter={StaticResource currencyConverter}, Path=CurrentPrice}" Width="85" />
27                    <GridViewColumn Header="Actions">
28                        <GridViewColumn.CellTemplate>
29                            <DataTemplate>
30                                    <Button Command="{Binding DataContext.RemoveWatchCommand, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}" CommandParameter="{Binding TickerSymbol}" AutomationProperties.AutomationId="ActionsRemoveButton" Template="{StaticResource RemoveXButtonTemplate}"  Cursor="Hand" />
31                            </DataTemplate>
32                        </GridViewColumn.CellTemplate>
33                    </GridViewColumn>
34                </GridView>
35            </ListView.View>
36        </ListView>
37    </StackPanel>
38</UserControl>