<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">
	<UserControl.Resources>
		<SolidColorBrush x:Key="OuterControlBorderBrush" Color="#3FFFFFFF"/>
		<SolidColorBrush x:Key="InnerControlBorderBrush" Color="Black"/>
		<LinearGradientBrush x:Key="ControlBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="#FF7E7E7E" Offset="0"/>
			<GradientStop Color="#FF484848" Offset="1"/>
			<GradientStop Color="#FF303030" Offset="0.1"/>
		</LinearGradientBrush>
		<telerik:FormatedNumberConverter x:Key="FormatedNumberConverter"/>
		<telerik:VisibilityConverter x:Key="VisibilityConverter"/>
		<telerikControls:Office_BlackTheme x:Key="Theme"/>
		<SolidColorBrush x:Key="ForegroundBrush" Color="White"/>
		<Style x:Key="ParameterEditorStyle" TargetType="ContentControl">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ContentControl">
						<Grid Height="30" Margin="5">
							<Grid.ColumnDefinitions>
								<ColumnDefinition MaxWidth="100" Width="auto"/>
								<ColumnDefinition Width="auto"/>
								<ColumnDefinition Width="auto"/>
								<ColumnDefinition Width="auto"/>
							</Grid.ColumnDefinitions>
							<TextBlock Grid.Column="0" Foreground="{StaticResource ForegroundBrush}" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
							<ContentPresenter Grid.Column="1" Margin="5, 0" VerticalAlignment="Center"/>
							<CheckBox Content="Null" Grid.Column="2" Foreground="{StaticResource ForegroundBrush}" IsChecked="{Binding IsNull, Mode=TwoWay}" Visibility="{Binding AllowNull, Converter={StaticResource VisibilityConverter}}" VerticalAlignment="Center"/>
							<telerik:ErrorStatus Grid.Column="3" Height="15" PropertyName="Value" Width="15"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<telerik:MultivalueParameterConverter x:Key="MultivalueParameterConverter"/>
		<telerik:ReportParameterEditorTemplateSelector x:Key="ReportParameterEditorTemplateSelector">
			<telerik:ReportParameterEditorTemplateSelector.Templates>
				<telerik:ReportParameterTemplate Type="System.Boolean">
					<ContentControl Style="{StaticResource ParameterEditorStyle}">
						<CheckBox IsChecked="{Binding Value, Mode=TwoWay}"/>
					</ContentControl>
				</telerik:ReportParameterTemplate>
				<telerik:ReportParameterTemplate AvailableValues="true" Multivalue="True">
					<ContentControl Style="{StaticResource ParameterEditorStyle}">
						<telerikInput:RadComboBox IsDropDownOpen="{Binding IsDropDownOpen, Mode=TwoWay}" ItemsSource="{Binding AvailableValues}" SelectedIndex="0" Width="200">
							<telerikInput:RadComboBox.ItemTemplate>
								<DataTemplate>
									<CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected, Mode=TwoWay}"/>
								</DataTemplate>
							</telerikInput:RadComboBox.ItemTemplate>
							<telerikInput:RadComboBox.SelectionBoxTemplate>
								<DataTemplate>
									<TextBlock HorizontalAlignment="Stretch" Text="{Binding Owner.SelectedLabels, Converter={StaticResource MultivalueParameterConverter}, Mode=OneWay}"/>
								</DataTemplate>
							</telerikInput:RadComboBox.SelectionBoxTemplate>
						</telerikInput:RadComboBox>
					</ContentControl>
				</telerik:ReportParameterTemplate>
				<telerik:ReportParameterTemplate AvailableValues="False" Multivalue="True">
					<ContentControl Style="{StaticResource ParameterEditorStyle}">
						<TextBox Text="{Binding Value, Converter={StaticResource MultivalueParameterConverter}, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" Width="200"/>
					</ContentControl>
				</telerik:ReportParameterTemplate>
				<telerik:ReportParameterTemplate AvailableValues="true">
					<ContentControl Style="{StaticResource ParameterEditorStyle}">
						<telerikInput:RadComboBox ItemsSource="{Binding AvailableValues}" SelectedItem="{Binding SelectedSingleValue, Mode=TwoWay}" Width="200">
							<telerikInput:RadComboBox.ItemTemplate>
								<DataTemplate>
									<TextBlock Text="{Binding Name}"/>
								</DataTemplate>
							</telerikInput:RadComboBox.ItemTemplate>
						</telerikInput:RadComboBox>
					</ContentControl>
				</telerik:ReportParameterTemplate>
				<telerik:ReportParameterTemplate Type="System.DateTime">
					<ContentControl Style="{StaticResource ParameterEditorStyle}">
						<telerikInput:RadDatePicker SelectedDate="{Binding Value, Mode=TwoWay}" Width="200"/>
					</ContentControl>
				</telerik:ReportParameterTemplate>
				<telerik:ReportParameterTemplate Multivalue="False">
					<ContentControl Style="{StaticResource ParameterEditorStyle}">
						<TextBox Text="{Binding Value, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" Width="200"/>
					</ContentControl>
				</telerik:ReportParameterTemplate>
			</telerik:ReportParameterEditorTemplateSelector.Templates>
		</telerik:ReportParameterEditorTemplateSelector>
		<SolidColorBrush x:Key="OuterViewerAreaBorderBrush" Color="#66FFFFFF"/>
		<SolidColorBrush x:Key="InnerViewerAreaBorderBrush" Color="Black"/>
		<SolidColorBrush x:Key="InnerViewerAreaBackground" Color="White"/>
		<telerikControls:ContainerBindingCollection x:Name="DocumentMapItemBindingsCollection">
			<telerikControls:ContainerBinding Binding="{Binding IsExpanded, Mode=TwoWay}" PropertyName="IsExpanded"/>
		</telerikControls:ContainerBindingCollection>
		<SolidColorBrush x:Key="PageBorderBorderBrush" Color="DarkGray"/>
		<SolidColorBrush x:Key="PageBorderBackground" Color="White"/>
		<Style x:Key="ProgressBarStyle" telerikControls:StyleManager.BasedOn="{StaticResource Theme}" TargetType="telerikControls:RadProgressBar">
			<Setter Property="IsIndeterminate" Value="True"/>
			<Setter Property="Height" Value="10"/>
			<Setter Property="Margin" Value="0, 10, 0, 0"/>
			<Setter Property="IsTabStop" Value="false"/>
		</Style>
		<SolidColorBrush x:Key="ErrorMessageForeground" Color="Gray"/>
		<telerik:ScaleFactorConverter x:Key="ScaleFactorConverter"/>
		<telerik:ZoomConverter x:Key="ZoomConverter"/>
		<Style x:Key="ReportViewerStyle1" TargetType="telerik:ReportViewer">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="telerik:ReportViewer">
						<Grid x:Name="LayoutRoot">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="ExportReportStateGroup">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="ExportNoExportState"/>
									<VisualState x:Name="ExportInProgressState">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExportDialog">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExportProgressBar">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="ExportCompleteState">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ExportDialog">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
								<VisualStateGroup x:Name="ViewerStateGroup">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="ViewerPageState"/>
									<VisualState x:Name="ViewerErrorState">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ViewerError">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PageScrollViewer">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="ViewerWorkInProgressState">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ViewerProgressMessage">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border BorderBrush="{StaticResource OuterControlBorderBrush}" BorderThickness="1" CornerRadius="6">
								<Border BorderBrush="{StaticResource InnerControlBorderBrush}" BorderThickness="1" Background="{StaticResource ControlBackgroundBrush}" CornerRadius="5" Margin="0" Padding="6">
									<Grid>
										<Grid.RowDefinitions>
											<RowDefinition Height="auto"/>
											<RowDefinition Height="auto"/>
											<RowDefinition Height="6"/>
											<RowDefinition Height="*"/>
											<RowDefinition Height="6"/>
											<RowDefinition Height="auto"/>
										</Grid.RowDefinitions>
										<telerikNav:RadToolBar Grid.Row="0" telerikControls:StyleManager.Theme="{StaticResource Theme}">
											<telerikControls:RadButton Command="{Binding NavigateBackCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/NavBack.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikControls:RadButton Command="{Binding NavigateForwardCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/NavForward.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikNav:RadToolBarSeparator/>
											<telerikControls:RadButton Command="{Binding RefreshReportCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/Refresh.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikNav:RadToolBarSeparator/>
											<telerikControls:RadButton Command="{Binding MoveToFirstPageCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/FirstPage.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikControls:RadButton Command="{Binding MoveToPreviousPageCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/PrevPage.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikNav:RadToolBarSeparator/>
											<TextBox IsEnabled="{Binding IsMoveToPageEnabled}" Margin="10, 0, 0, 0" MinWidth="30" TextAlignment="Center" Text="{Binding PageNumber, Mode=TwoWay}" VerticalAlignment="Center"/>
											<TextBlock Margin="2, 0, 10, 0" TextAlignment="Center" Text="{Binding PageCount, ConverterParameter=of \{0\} pages, Converter={StaticResource FormatedNumberConverter}}" VerticalAlignment="Center"/>
											<telerikNav:RadToolBarSeparator/>
											<telerikControls:RadButton Command="{Binding MoveToNextPageCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/NextPage.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikControls:RadButton Command="{Binding MoveToLastPageCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/LastPage.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikNav:RadToolBarSeparator/>
											<telerikControls:RadButton Command="{Binding PrintReportCommand}" Margin="0,2" Padding="2">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/Print.png" Width="16"/>
											</telerikControls:RadButton>
											<telerikInput:RadComboBox DisplayMemberPath="LocalizedName" Height="24" ItemsSource="{Binding RenderingExtensions}" IsEnabled="{Binding IsExportEnabled}" Margin="1,0" Padding="2,0" SelectedItem="{Binding SelectedRenderingExtension, Mode=TwoWay}" Width="45">
												<telerikInput:RadComboBox.EmptySelectionBoxTemplate>
													<DataTemplate>
														<Image HorizontalAlignment="Left" Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/Export.png" Width="16"/>
													</DataTemplate>
												</telerikInput:RadComboBox.EmptySelectionBoxTemplate>
											</telerikInput:RadComboBox>
											<telerikNav:RadToolBarSeparator/>
											<telerikControls:RadToggleButton IsChecked="{Binding IsDocumentMapVisible, Mode=TwoWay}" Margin="0,2" Padding="2" Visibility="{Binding HasDocumentMap, Converter={StaticResource VisibilityConverter}}">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/DocumentMap.png" Width="16"/>
											</telerikControls:RadToggleButton>
											<telerikControls:RadToggleButton IsChecked="{Binding IsParametersAreaVisible, Mode=TwoWay}" Margin="0,2" Padding="2" Visibility="{Binding HasParameters, Converter={StaticResource VisibilityConverter}}">
												<Image Height="16" Source="/Telerik.ReportViewer.Silverlight;component/images/Parameters.png" Width="16"/>
											</telerikControls:RadToggleButton>
										</telerikNav:RadToolBar>
										<Border x:Name="ParametersAreaPane" Grid.Row="1" Visibility="{Binding IsParametersAreaVisible, Converter={StaticResource VisibilityConverter}}">
											<Grid>
												<Grid>
													<Grid.ColumnDefinitions>
														<ColumnDefinition Width="*"/>
														<ColumnDefinition Width="Auto"/>
													</Grid.ColumnDefinitions>
													<Grid Grid.Column="0">
														<telerik:ReportParametersControl Foreground="{StaticResource ForegroundBrush}" ItemsSource="{Binding ParameterModels}" ParameterTemplateSelector="{StaticResource ReportParameterEditorTemplateSelector}">
															<telerik:ReportParametersControl.ItemsPanel>
																<ItemsPanelTemplate>
																	<telerikPrimitives:RadUniformGrid Columns="2"/>
																</ItemsPanelTemplate>
															</telerik:ReportParametersControl.ItemsPanel>
														</telerik:ReportParametersControl>
													</Grid>
													<Grid Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Bottom">
														<telerikControls:RadButton Content="Preview" Command="{Binding ApplyReportParametersCommand}" Margin="3" Padding="10, 3" telerikControls:StyleManager.Theme="{StaticResource Theme}"/>
													</Grid>
												</Grid>
											</Grid>
										</Border>
										<Grid Grid.Row="3">
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="auto"/>
												<ColumnDefinition Width="*"/>
											</Grid.ColumnDefinitions>
											<Border x:Name="DocumentMapPane" Grid.Column="0" Visibility="{Binding IsDocumentMapVisible, Converter={StaticResource VisibilityConverter}}" Width="200">
												<Border BorderBrush="{StaticResource OuterViewerAreaBorderBrush}" BorderThickness="1" Grid.Column="2" CornerRadius="4" Margin="0, 0, 6, 0">
													<Border BorderBrush="{StaticResource InnerViewerAreaBorderBrush}" BorderThickness="1" Background="{StaticResource InnerViewerAreaBackground}" CornerRadius="3" Margin="0">
														<telerikNav:RadTreeView x:Name="DocumentMapTreeView" Background="{StaticResource InnerViewerAreaBackground}" ItemsSource="{Binding DocumentMapNodes}" IsEnabled="{Binding IsMoveToPageEnabled}" SelectedItem="{Binding SelectedDocumentMapNode, Mode=TwoWay}" telerikControls:StyleManager.Theme="{StaticResource Theme}">
															<telerikNav:RadTreeView.ItemTemplate>
																<telerikControls:HierarchicalDataTemplate telerikControls:ContainerBinding.ContainerBindings="{StaticResource DocumentMapItemBindingsCollection}" ItemsSource="{Binding Children}">
																	<TextBlock Text="{Binding Text}"/>
																</telerikControls:HierarchicalDataTemplate>
															</telerikNav:RadTreeView.ItemTemplate>
														</telerikNav:RadTreeView>
													</Border>
												</Border>
											</Border>
											<Border BorderBrush="{StaticResource OuterViewerAreaBorderBrush}" BorderThickness="1" Grid.Column="2" CornerRadius="4">
												<Border BorderBrush="{StaticResource InnerViewerAreaBorderBrush}" BorderThickness="1" Background="{StaticResource InnerViewerAreaBackground}" CornerRadius="3" Margin="0">
													<Grid>
														<ScrollViewer x:Name="PageScrollViewer" BorderThickness="0" telerikControls:ScrollViewerExtensions.EnableMouseWheel="True" HorizontalScrollBarVisibility="Auto" Visibility="Visible" VerticalScrollBarVisibility="Visible">
															<Border x:Name="PageBorder" BorderBrush="{StaticResource PageBorderBorderBrush}" BorderThickness="1" Background="{StaticResource PageBorderBackground}" Height="{Binding PageHeight}" Margin="10" Width="{Binding PageWidth}">
																<telerikPrimitives:LayoutTransformControl x:Name="PageContainer" Content="{Binding PageRoot}" LayoutTransform="{Binding PageTransform}"/>
															</Border>
														</ScrollViewer>
														<telerik:DialogBox x:Name="ViewerProgressMessage" Visibility="Collapsed">
															<Grid Margin="20">
																<Grid.RowDefinitions>
																	<RowDefinition/>
																	<RowDefinition Height="auto"/>
																</Grid.RowDefinitions>
																<TextBlock HorizontalAlignment="Center" Text="{Binding ProgressMessage}" VerticalAlignment="Center"/>
																<telerikControls:RadProgressBar Grid.Row="1" Style="{StaticResource ProgressBarStyle}"/>
															</Grid>
														</telerik:DialogBox>
														<TextBox x:Name="ViewerError" BorderThickness="0" Background="{StaticResource InnerViewerAreaBackground}" Foreground="{StaticResource ErrorMessageForeground}" FontFamily="Verdana" HorizontalAlignment="Stretch" IsReadOnly="True" Padding="20" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding Error}" Visibility="Collapsed" VerticalAlignment="Stretch"/>
														<telerik:DialogBox x:Name="ExportDialog" Visibility="Collapsed">
															<Grid Width="270">
																<Grid.RowDefinitions>
																	<RowDefinition Height="100"/>
																	<RowDefinition Height="auto"/>
																</Grid.RowDefinitions>
																<Grid HorizontalAlignment="Stretch" Margin="20" VerticalAlignment="Center">
																	<Grid.RowDefinitions>
																		<RowDefinition/>
																		<RowDefinition Height="auto"/>
																	</Grid.RowDefinitions>
																	<TextBlock HorizontalAlignment="Center" Text="{Binding ExportProgress}" VerticalAlignment="Center"/>
																	<telerikControls:RadProgressBar x:Name="ExportProgressBar" Grid.Row="1" Style="{StaticResource ProgressBarStyle}" Visibility="Collapsed"/>
																</Grid>
																<Grid Grid.Row="1">
																	<Grid.ColumnDefinitions>
																		<ColumnDefinition Width="*"/>
																		<ColumnDefinition Width="auto"/>
																		<ColumnDefinition Width="auto"/>
																	</Grid.ColumnDefinitions>
																	<telerikControls:RadButton Content="Save" Grid.Column="1" Command="{Binding SaveExportCommand}" Margin="5" Padding="10, 3" telerikControls:StyleManager.Theme="{StaticResource Theme}"/>
																	<telerikControls:RadButton Content="Cancel" Grid.Column="2" Command="{Binding CancelExportCommand}" Margin="5" Padding="10, 3" telerikControls:StyleManager.Theme="{StaticResource Theme}"/>
																</Grid>
															</Grid>
														</telerik:DialogBox>
													</Grid>
												</Border>
											</Border>
										</Grid>
										<Grid Grid.Row="5">
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="*"/>
												<ColumnDefinition Width="auto"/>
											</Grid.ColumnDefinitions>
											<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
												<telerikControls:RadSlider HandlesVisibility="Visible" Maximum="100" Minimum="-100" SmallChange="10" telerikControls:StyleManager.Theme="{StaticResource Theme}" Value="{Binding Zoom, Converter={StaticResource ScaleFactorConverter}, Mode=TwoWay}" VerticalAlignment="Center" Width="200"/>
												<telerikInput:RadComboBox HorizontalAlignment="Center" IsEditable="True" ItemsSource="{Binding AvailableZoomValues, Converter={StaticResource ZoomConverter}}" IsTextSearchEnabled="False" Margin="10, 0, 3, 0" MaxDropDownHeight="300" Text="{Binding Zoom, Converter={StaticResource ZoomConverter}, Mode=TwoWay}" telerikControls:StyleManager.Theme="{StaticResource Theme}" VerticalAlignment="Center" Width="70"/>
											</StackPanel>
										</Grid>
									</Grid>
								</Border>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    
    <Grid x:Name="LayoutRoot">
        
        <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="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="ClassLibrary1.Report1, ClassLibrary1" RenderBegin="ReportViewer1_RenderBegin" Style="{StaticResource ReportViewerStyle1}" />
        </Grid>
  </Grid>
</UserControl>
