<UserControl x:Class="TradeBlotter.Views.EarningsAnnouncementView"
             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="{Binding Path=BusyContent}">
  <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="Select Days Out..." HorizontalAlignment="Center"></Label>
      <TextBox Text="{Binding Path=DaysOut, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="False" IsReadOnly="False" />
      <Button Content="Go" Command="{Binding Path=RefreshCommand}"></Button>
    </StackPanel>
    <DockPanel Grid.Row="2" Grid.Column="2" >
    <telerik:RadGridView  CanUserSelect="True"  SelectionMode="Single" 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:GridViewDataColumn IsReadOnly="True" Header="Company Name" DataMemberBinding="{Binding Path=CompanyName}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Next Earnings Date" DataMemberBinding="{Binding Path=NextEarningsDate,StringFormat='{}{0:MM/dd/yyyy}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Days" DataMemberBinding="{Binding Path=DaysFromToday}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Last Price" DataMemberBinding="{Binding Path=LastPrice,StringFormat='{}{0:C}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Upside" DataMemberBinding="{Binding Path=Upside,StringFormat='{}{0:C}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Downside" DataMemberBinding="{Binding Path=Downside,StringFormat='{}{0:C}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Upside(%)" DataMemberBinding="{Binding Path=UpsidePcnt,StringFormat='{}{0:P}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Downside(%)" DataMemberBinding="{Binding Path=DownsidePcnt,StringFormat='{}{0:P}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="PE" DataMemberBinding="{Binding Path=PE,StringFormat='{}{0:F}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="PEG" DataMemberBinding="{Binding Path=PEG,StringFormat='{}{0:F}'}" />
      <!--<telerik:GridViewDataColumn IsReadOnly="True" Header="Implied Earnings Growth" DataMemberBinding="{Binding Path=AnticipatedEarningsGrowth,StringFormat='{}{0:P}'}" />-->
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Implied Earnings Growth" DataMemberBinding="{Binding Path=AnticipatedEarningsGrowthStr}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="PEG Valuation" DataMemberBinding="{Binding Path=PEGValuation}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Pricing Date" DataMemberBinding="{Binding Path=PricingDate,StringFormat='{}{0:MM/dd/yyyy}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Fundamental Date" DataMemberBinding="{Binding Path=FundamentalDate,StringFormat='{}{0:MM/dd/yyyy}'}" />
      <telerik:GridViewDataColumn IsReadOnly="True" Header="Price Target Date" DataMemberBinding="{Binding Path=PriceTargetDate,StringFormat='{}{0:MM/dd/yyyy}'}" />
    </telerik:RadGridView.Columns>
    </telerik:RadGridView>
    </DockPanel>
  </Grid>
  </DockPanel>
 </Grid>
 </wpfx:BusyIndicator>
</UserControl>
