<UserControl x:Class="CSharp.SilverlightDemo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:telerik="clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight"    
    xmlns:telerikNav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikPrimitives ="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
             xmlns:local="clr-namespace:CSharp.SilverlightDemo"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    
    <Grid x:Name="LayoutRoot">
        <Grid.DataContext>
            <local:MainPageModel ReportServiceUri="../ReportService.svc"/>
        </Grid.DataContext>        
        <Image Source="/CSharp.SilverlightDemo;component/images/BgOfficeBlack.jpg" Stretch="Fill" />
        <Grid HorizontalAlignment="Center" Margin="20" >
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/> 
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>

                <StackPanel Grid.Column="0" Orientation="Horizontal">
                    <TextBlock Text="Reports:" FontWeight="Bold" Foreground="Gray" VerticalAlignment="Center"/>

                    <ComboBox Height="23" Width="400" 
                                          Margin="5, 0" 
                                          VerticalAlignment="Center"
                              HorizontalAlignment="Left" 
                              Name="AvailableReportsComboBox" 
                              ItemsSource="{Binding Path=AvailableReports, Mode=OneWay}" 
                              SelectedValue="{Binding Path=SelectedReport, Mode=TwoWay}"  
                              DisplayMemberPath="Name" />
                </StackPanel>

                <StackPanel Grid.Column="1" Orientation="Horizontal">
                    <TextBlock Text="Theme:" Margin="5, 0" FontWeight="Bold" Foreground="Gray" VerticalAlignment="Center"/>
                    <telerikInput:RadComboBox x:Name="ThemeSelector" 
                                          Width="120"
                                          VerticalAlignment="Center"
                                          SelectedIndex="0">
                        <telerikControls:Office_BlackTheme />
                        <telerikControls:Office_BlueTheme />
                        <telerikControls:Office_SilverTheme />
                        <telerikControls:SummerTheme />
                        <telerikControls:Windows7Theme />
                        <telerikControls:VistaTheme />
                    </telerikInput:RadComboBox>
                </StackPanel>

            </Grid>
            
            <telerik:ReportViewer Grid.Row="1" x:Name="ReportViewer1" 
                                  Width="1000"
                                  telerikControls:StyleManager.Theme="{Binding SelectedItem, ElementName=ThemeSelector}"
                                  ReportServiceUri="../ReportService.svc"
                                  Report="{Binding SelectedItem.FullName, ElementName=AvailableReportsComboBox}"></telerik:ReportViewer>
        </Grid>
  </Grid>
</UserControl>
