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

/V2.2/trunk/RI/Silverlight/StockTraderRI.Modules.Watch.Silverlight/WatchList/WatchListView.xaml

#
XAML | 37 lines | 35 code | 1 blank | 1 comment | 0 complexity | d911f080455dd375a1b8d4c4c9d7ada4 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:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
  5. xmlns:Converters="clr-namespace:StockTraderRI.Infrastructure.Converters;assembly=StockTraderRI.Infrastructure"
  6. xmlns:Commands="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation"
  7. xmlns:Infrastructure="clr-namespace:StockTraderRI.Infrastructure;assembly=StockTraderRI.Infrastructure"
  8. Height="Auto" Width="Auto">
  9. <UserControl.Resources>
  10. <Converters:CurrencyConverter x:Key="currencyConverter" />
  11. <!-- The following resources are used as a workaround because in Silverlight we cannot bind to a RelativeSource -->
  12. <Infrastructure:ObservableCommand x:Key="RemoveWatchCommand" />
  13. </UserControl.Resources>
  14. <Controls:DataGrid x:Name="WatchListGrid" ItemsSource="{Binding Path=WatchListItems}"
  15. AutoGenerateColumns="False" BorderThickness="0,0,0,0" Width="Auto"
  16. HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="{x:Null}"
  17. BorderBrush="{x:Null}" HeadersVisibility="Column"
  18. Style="{StaticResource CustomDataGridStyle}" GridLinesVisibility="None"
  19. Foreground="#FF666666" CellStyle="{StaticResource NoSelectionDataGridCellStyle}"
  20. ColumnHeaderStyle="{StaticResource CustomHeaderStyle}"
  21. SelectionMode="Single" IsReadOnly="True"
  22. DragIndicatorStyle="{StaticResource CustomHeaderStyle}"
  23. RowStyle="{StaticResource CustomGridRowStyle}" AutomationProperties.AutomationId="WatchListGrid" >
  24. <Controls:DataGrid.Columns>
  25. <Controls:DataGridTextColumn Header="Symbol" Binding="{Binding Path=TickerSymbol}"/>
  26. <Controls:DataGridTextColumn Header="Current Price" Binding="{Binding Converter={StaticResource currencyConverter}, Path=CurrentPrice}"/>
  27. <Controls:DataGridTemplateColumn Header="Actions">
  28. <Controls:DataGridTemplateColumn.CellTemplate>
  29. <DataTemplate>
  30. <Button Commands:Click.Command="{Binding Path=Value, Source={StaticResource RemoveWatchCommand}}" Commands:Click.CommandParameter="{Binding Path=TickerSymbol}" AutomationProperties.AutomationId="ActionsRemoveButton" Template="{StaticResource RemoveXButtonTemplate}" Cursor="Hand" />
  31. </DataTemplate>
  32. </Controls:DataGridTemplateColumn.CellTemplate>
  33. </Controls:DataGridTemplateColumn>
  34. </Controls:DataGrid.Columns>
  35. </Controls:DataGrid>
  36. </UserControl>