<UserControl x:Class="TradeBlotter.Views.WatchListView"
						 xmlns:vw="clr-namespace:TradeBlotter.Views"						 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:wpfx="http://schemas.xceed.com/wpf/xaml/toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
	<UserControl.Resources>
		<Style x:Key="TradeItemStyle" TargetType="{x:Type telerik:RadGridView}">
		</Style>
	</UserControl.Resources>
	<wpfx:BusyIndicator Name="BusyBar" IsBusy="{Binding Path=BusyIndicator}" BusyContent="Loading Watchlist Items...">
		<Grid  Background="LightGray">
			<DockPanel>
				<Grid DockPanel.Dock="Left" Margin="0,2,4,2">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto" />
						<ColumnDefinition Width="6" />
						<ColumnDefinition Width="*" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="35" />
						<RowDefinition Height="3" />
						<RowDefinition Height="*" />
					</Grid.RowDefinitions>
					<Label Grid.Row="0" Grid.Column="2" FontFamily="Arial" Content="{Binding Path=Title}" HorizontalAlignment="Center" FontSize="20"></Label>
					<StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="0">
						<Label Content="Watch List" HorizontalAlignment="Left" ></Label>
						<ComboBox ItemsSource="{Binding Path=WatchListNames, Mode=OneTime}" SelectedItem="{Binding Path=SelectedWatchList, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{x:Null}" ></ComboBox>
						<Button Margin="0,2" Content="Refresh" HorizontalAlignment="Left" Command="{Binding Path=RefreshCommand}"></Button>
					</StackPanel>
					<DockPanel Grid.Row="2" Grid.Column="2" >
						<telerik:RadGridView SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemContainerStyle="{StaticResource TradeItemStyle}" AlternationCount="2" AlternateRowBackground="Bisque" ShowGroupFooters="True" ShowColumnFooters="True" ItemsSource="{Binding Path=AllItems, ValidatesOnDataErrors=True}" AutoGenerateColumns="False" >
							<telerik:RadContextMenu.ContextMenu>
								<telerik:RadContextMenu x:Name="GridContextMenu" StaysOpen="False" ItemsSource="{Binding MenuItems}">
									<telerik:RadContextMenu.ItemContainerStyle>
										<Style TargetType="telerik:RadMenuItem">
											<Setter Property="Header" Value="{Binding Text}" />
											<Setter Property="Command" Value="{Binding MenuItemClickedCommand}" />
											<Setter Property="StaysOpenOnClick" Value="False" />
										</Style>
									</telerik:RadContextMenu.ItemContainerStyle>
								</telerik:RadContextMenu>
							</telerik:RadContextMenu.ContextMenu>
							<telerik:RadGridView.Columns>
								<telerik:GridViewDataColumn IsReadOnly="True" Header="Symbol" DataMemberBinding="{Binding Path=Symbol}" >
									<telerik:GridViewColumn.ToolTipTemplate>
										<DataTemplate >
											<StackPanel Orientation="Horizontal" >
												<TextBlock Background="LemonChiffon" MaxWidth="1000" TextWrapping="Wrap" Text="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type vw:WatchListView}},Path=DataContext.Description}"/>
											</StackPanel>
										</DataTemplate>
									</telerik:GridViewColumn.ToolTipTemplate>
							 </telerik:GridViewDataColumn>
								<telerik:GridViewDataColumn IsReadOnly="True" Header="Company Name" DataMemberBinding="{Binding Path=CompanyName}" />
								<telerik:GridViewDataColumn IsReadOnly="True" Header="Sector" DataMemberBinding="{Binding Path=Sector}" />
								<telerik:GridViewDataColumn IsReadOnly="True" Header="Industry" DataMemberBinding="{Binding Path=Industry}" />
								<telerik:GridViewDataColumn IsReadOnly="True" Header="Security Type" DataMemberBinding="{Binding Path=SecurityType}" />
							</telerik:RadGridView.Columns>
						</telerik:RadGridView>
					</DockPanel>
				</Grid>
			</DockPanel>
		</Grid>
	</wpfx:BusyIndicator>
</UserControl>

