<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Telerik.ReportViewer.Wpf;assembly=Telerik.ReportViewer.Wpf" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
    xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikPrimitives ="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
    xmlns:Telerik_Windows_Controls_Chromes="clr-namespace:Telerik.Windows.Controls.Chromes;assembly=Telerik.Windows.Controls" 
    x:Class="TermEPowerStats"
    x:Name="TerminalEPowerStatistics"
    Title="Terminal E Power Statistics" Height="405" Width="789" WindowStyle="None" AllowsTransparency="True" Background="{x:Null}"  ResizeMode="CanResizeWithGrip">
    <Window.Resources>
        <my:VisibilityConverter x:Key="VisibilityConverter" />
        <my:FormatedNumberConverter x:Key="FormatedNumberConverter" />
        <my:ZoomConverter x:Key="ZoomConverter" />
        <my:ScaleFactorConverter x:Key="ScaleFactorConverter" />
        <my:MultivalueParameterConverter x:Key="MultivalueParameterConverter" />

        <SolidColorBrush x:Key="OuterControlBorderBrush" Color="#3FFFFFFF" />
        <SolidColorBrush x:Key="InnerControlBorderBrush" Color="#FFA0AFC3" />
        <SolidColorBrush x:Key="ControlBackgroundBrush" Color="#FFF1F5FB" />

        <SolidColorBrush x:Key="OuterViewerAreaBorderBrush" Color="#66FFFFFF" />
        <SolidColorBrush x:Key="InnerViewerAreaBorderBrush" Color="#FFA0AFC3" />
        <SolidColorBrush x:Key="InnerViewerAreaBackground" Color="White" />

        <SolidColorBrush x:Key="ForegroundBrush" Color="Black" />

        <SolidColorBrush x:Key="PageBorderBackground" Color="White" />
        <SolidColorBrush x:Key="PageBorderBorderBrush" Color="DarkGray" />

        <SolidColorBrush x:Key="ErrorMessageForeground" Color="Gray" />

        <Style TargetType="ContentControl" x:Key="ParameterEditorStyle">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContentControl">
                        <Grid Margin="5" Height="30">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" MinWidth="100"/>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="auto" />
                            </Grid.ColumnDefinitions>

                            <TextBlock Grid.Column="0" 
                                   TextWrapping="Wrap" 
                                   Foreground="{StaticResource ForegroundBrush}"
                                   Text="{Binding Text}" 
                                   VerticalAlignment="Center" 
                                   HorizontalAlignment="Left" />

                            <ContentPresenter Grid.Column="1" 
                                          Margin="5, 0" 
                                          VerticalAlignment="Center" />

                            <CheckBox Grid.Column="2" 
                                  VerticalAlignment="Center"
                                  Foreground="{StaticResource ForegroundBrush}"
                                  Content="Null"
                                  IsChecked="{Binding IsNull, Mode=TwoWay}"                                   
                                  Visibility="{Binding AllowNull, Converter={StaticResource VisibilityConverter}}" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <my:ReportParameterEditorTemplateSelector x:Key="ReportParameterEditorTemplateSelector">
            <my:ReportParameterEditorTemplateSelector.Templates>
                <!-- 
                                                Note:
                                                Order the templates from most specific to most general (less specific).
                                                The 1st template that matches the parameter is picked 
                                            -->



                <!-- BOOLEAN -->
                <DataTemplate >
                    <my:ParameterContentControl Style="{StaticResource ParameterEditorStyle}" Type="System.Boolean">
                        <CheckBox IsChecked="{Binding Value, Mode=TwoWay}" />
                    </my:ParameterContentControl>
                </DataTemplate>

                <!-- MULTIVALUE + AVAILABLE VALUES -->
                <DataTemplate >
                    <my:ParameterContentControl Style="{StaticResource ParameterEditorStyle}" AvailableValues="true" Multivalue="True">
                        <telerikInput:RadComboBox Width="200" 
                                              ItemsSource="{Binding AvailableValues}" 
                                              telerikControls:StyleManager.Theme="Expression_Dark"
                                              SelectedIndex="0"
                                              IsDropDownOpen="{Binding IsDropDownOpen, Mode=TwoWay}"
                                              CanAutocompleteSelectItems="False"
                                              CanKeyboardNavigationSelectItems="False"
                                              IsTextSearchEnabled="False">
                            <telerikInput:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Name}" />
                                </DataTemplate>
                            </telerikInput:RadComboBox.ItemTemplate>
                            <telerikInput:RadComboBox.SelectionBoxTemplate>
                                <DataTemplate>
                                    <TextBlock HorizontalAlignment="Stretch" 
                                           Text="{Binding Owner.SelectedLabels, Mode=OneWay, Converter={StaticResource MultivalueParameterConverter}}" />
                                </DataTemplate>
                            </telerikInput:RadComboBox.SelectionBoxTemplate>
                        </telerikInput:RadComboBox>
                    </my:ParameterContentControl>
                </DataTemplate>

                <!-- MULTIVALUE + NO AVAILABLE VALUES -->
                <DataTemplate >
                    <my:ParameterContentControl Style="{StaticResource ParameterEditorStyle}" Multivalue="True" AvailableValues="False">
                        <TextBox Text="{Binding Value, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true, Converter={StaticResource MultivalueParameterConverter}}"
                             Width="200" />
                    </my:ParameterContentControl>
                </DataTemplate>

                <!-- AVAILABLE VALUES -->
                <DataTemplate>
                    <my:ParameterContentControl Style="{StaticResource ParameterEditorStyle}" AvailableValues="true">
                        <telerikInput:RadComboBox Width="200" 
                                              ItemsSource="{Binding AvailableValues}" 
                                              SelectedItem="{Binding SelectedSingleValue, Mode=TwoWay}"
                                              telerikControls:StyleManager.Theme="Expression_Dark">
                            <telerikInput:RadComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Name}" />
                                </DataTemplate>
                            </telerikInput:RadComboBox.ItemTemplate>
                        </telerikInput:RadComboBox>
                    </my:ParameterContentControl>
                </DataTemplate>

                <!-- DATETIME -->
                <DataTemplate>
                    <my:ParameterContentControl Style="{StaticResource ParameterEditorStyle}" Type="System.DateTime">
                        <telerikInput:RadDatePicker Width="200" 
                                                telerikControls:StyleManager.Theme="Expression_Dark"
                                                SelectedDate="{Binding Value, Mode=TwoWay}" />
                    </my:ParameterContentControl>
                </DataTemplate>

                <!-- GENERIC EDITOR -->
                <DataTemplate>
                    <my:ParameterContentControl Style="{StaticResource ParameterEditorStyle}" 
                                               Multivalue="False">
                        <TextBox Text="{Binding Value, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}"
                             Width="200" />
                    </my:ParameterContentControl>
                </DataTemplate>

            </my:ReportParameterEditorTemplateSelector.Templates>
        </my:ReportParameterEditorTemplateSelector>

        <Style x:Key="ReportViewerStyle2" TargetType="{x:Type my:ReportViewer}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:ReportViewer}">
                        <Grid x:Name="LayoutRoot">
                            <Border BorderBrush="#3FFFFFFF" BorderThickness="1" CornerRadius="6">
                                <Border BorderBrush="Black" BorderThickness="1" CornerRadius="5" Margin="0" Padding="6">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF2F2F2F" Offset="0"/>
                                            <GradientStop Color="Black" Offset="1"/>
                                            <GradientStop Color="Black" Offset="0.1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="6"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="6"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <telerik:RadToolBar Grid.Row="0">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                            <telerik:RadButton Command="{Binding NavigateBackCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NavBack.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadButton Command="{Binding NavigateForwardCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NavForward.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding RefreshReportCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Refresh.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding MoveToFirstPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/FirstPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadButton Command="{Binding MoveToPreviousPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/PrevPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik: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" VerticalAlignment="Center">
												<TextBlock.Text>
													<Binding ConverterParameter="of {0} pages" Path="PageCount">
														<Binding.Converter>
															<my:FormatedNumberConverter/>
														</Binding.Converter>
													</Binding>
												</TextBlock.Text>
                                            </TextBlock>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding MoveToNextPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NextPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadButton Command="{Binding MoveToLastPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/LastPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding PrintReportCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Print.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadComboBox Height="24" IsEnabled="{Binding IsExportEnabled}" ItemsSource="{Binding RenderingExtensions}" SelectedItem="{Binding SelectedRenderingExtension, Mode=TwoWay}" Margin="1,0" Padding="2,0" Width="45" MaxDropDownHeight="300">
                                                <telerik:RadComboBox.EmptySelectionBoxTemplate>
                                                    <DataTemplate>
                                                        <Image HorizontalAlignment="Left" Height="16" Visibility="Visible" Width="16">
                                                            <Image.Source>
                                                                <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Export.png"/>
                                                            </Image.Source>
                                                        </Image>
                                                    </DataTemplate>
                                                </telerik:RadComboBox.EmptySelectionBoxTemplate>
                                                <telerik:RadComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock MinWidth="150" Text="{Binding Description}"/>
                                                    </DataTemplate>
                                                </telerik:RadComboBox.ItemTemplate>
                                                <telerik:RadComboBox.SelectionBoxTemplate>
                                                    <DataTemplate>
                                                        <Image HorizontalAlignment="Left" Height="16" Visibility="Visible" Width="16">
                                                            <Image.Source>
                                                                <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Export.png"/>
                                                            </Image.Source>
                                                        </Image>
                                                    </DataTemplate>
                                                </telerik:RadComboBox.SelectionBoxTemplate>
                                            </telerik:RadComboBox>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadToggleButton IsChecked="{Binding IsDocumentMapVisible, Mode=TwoWay}" Margin="0,2" Padding="2">
                                                <telerik:RadToggleButton.Visibility>
                                                    <Binding Path="HasDocumentMap">
                                                        <Binding.Converter>
                                                            <my:VisibilityConverter/>
                                                        </Binding.Converter>
                                                    </Binding>
                                                </telerik:RadToggleButton.Visibility>
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/DocumentMap.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadToggleButton>
                                            <telerik:RadToggleButton IsChecked="{Binding IsParametersAreaVisible, Mode=TwoWay}" Margin="0,2" Padding="2">
                                                <telerik:RadToggleButton.Visibility>
                                                    <Binding Path="HasParameters">
                                                        <Binding.Converter>
                                                            <my:VisibilityConverter/>
                                                        </Binding.Converter>
                                                    </Binding>
                                                </telerik:RadToggleButton.Visibility>
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Parameters.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadToggleButton>
                                        </telerik:RadToolBar>
                                        <Border x:Name="ParametersAreaPane" Grid.Row="1">
                                            <Border.Visibility>
                                                <Binding Path="IsParametersAreaVisible">
                                                    <Binding.Converter>
                                                        <my:VisibilityConverter/>
                                                    </Binding.Converter>
                                                </Binding>
                                            </Border.Visibility>
                                            <Grid>
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                    </Grid.ColumnDefinitions>
                                                    <Grid Grid.Column="0">
                                                        <my:ReportParametersControl ParameterTemplateSelector="{StaticResource ReportParameterEditorTemplateSelector}"
                                                                                    Foreground="{StaticResource ForegroundBrush}"
                                                                                    ItemsSource="{Binding ParameterModels}">
                                                            <ItemsControl.ItemsPanel>
                                                                <ItemsPanelTemplate>
                                                                    <telerikPrimitives:RadUniformGrid Columns="2" />
                                                                    <!--<telerikControls:RadWrapPanel />-->
                                                                </ItemsPanelTemplate>
                                                            </ItemsControl.ItemsPanel>
                                                        </my:ReportParametersControl>
                                                    </Grid>
                                                    <Grid Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                                                        <telerik:RadButton Content="Preview" Command="{Binding PreviewReportCommand}" Margin="3" Padding="10,3">
                                                            <telerik:StyleManager.Theme>
                                                                <telerik:Office_BlackTheme/>
                                                            </telerik:StyleManager.Theme>
                                                        </telerik:RadButton>
                                                    </Grid>
                                                </Grid>
                                                <my:DialogBox x:Name="UpdateParametersDialog">
                                                    <my:DialogBox.Visibility>
                                                        <Binding Path="IsUpdatingParameters">
                                                            <Binding.Converter>
                                                                <my:VisibilityConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </my:DialogBox.Visibility>
                                                    <Grid Margin="20">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition/>
                                                            <RowDefinition Height="Auto"/>
                                                        </Grid.RowDefinitions>
                                                        <TextBlock HorizontalAlignment="Center" Text="{Binding UpdateParametersProgress}" VerticalAlignment="Center"/>
                                                        <telerik:RadProgressBar Grid.Row="1">
                                                            <telerik:RadProgressBar.Style>
                                                                <Style TargetType="{x:Type telerik: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>
                                                            </telerik:RadProgressBar.Style>
                                                            <telerik:StyleManager.Theme>
                                                                <telerik:Office_BlackTheme/>
                                                            </telerik:StyleManager.Theme>
                                                        </telerik:RadProgressBar>
                                                    </Grid>
                                                </my:DialogBox>
                                            </Grid>
                                        </Border>
                                        <Grid Grid.Row="3">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Border x:Name="DocumentMapPane" Grid.Column="0" Width="200">
                                                <Border.Visibility>
                                                    <Binding Path="IsDocumentMapVisible">
                                                        <Binding.Converter>
                                                            <my:VisibilityConverter/>
                                                        </Binding.Converter>
                                                    </Binding>
                                                </Border.Visibility>
                                                <Border BorderBrush="#66FFFFFF" BorderThickness="1" Grid.Column="2" CornerRadius="4" Margin="0,0,6,0">
                                                    <Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="3" Margin="0">
                                                        <telerik:RadTreeView x:Name="DocumentMapTreeView" Background="White" ScrollViewer.HorizontalScrollBarVisibility="Auto" IsVirtualizing="False" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                                            <telerik:RadTreeView.ItemTemplate>
                                                                <HierarchicalDataTemplate AlternationCount="0" ItemBindingGroup="{x:Null}" ItemTemplate="{x:Null}" ItemContainerStyleSelector="{x:Null}" ItemStringFormat="{x:Null}" ItemsSource="{Binding Children}" ItemContainerStyle="{x:Null}" ItemTemplateSelector="{x:Null}">
                                                                    <TextBlock Text="{Binding Text}"/>
                                                                </HierarchicalDataTemplate>
                                                            </telerik:RadTreeView.ItemTemplate>
                                                            <telerik:RadTreeView.ItemContainerStyle>
                                                                <Style TargetType="{x:Type telerik:RadTreeViewItem}">
                                                                    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
                                                                </Style>
                                                            </telerik:RadTreeView.ItemContainerStyle>
                                                            <telerik:RadTreeView.Style>
                                                                <Style TargetType="{x:Type telerik:RadTreeView}">
                                                                    <Setter Property="IsEnabled" Value="{Binding IsMoveToPageEnabled}"/>
                                                                    <Setter Property="SelectedItem" Value="{Binding SelectedDocumentMapNode, Mode=TwoWay}"/>
                                                                    <Setter Property="ItemsSource" Value="{Binding DocumentMapNodes}"/>
                                                                </Style>
                                                            </telerik:RadTreeView.Style>
                                                            <telerik:StyleManager.Theme>
                                                                <telerik:Office_BlackTheme/>
                                                            </telerik:StyleManager.Theme>
                                                        </telerik:RadTreeView>
                                                    </Border>
                                                </Border>
                                            </Border>
                                            <Border BorderBrush="#66FFFFFF" BorderThickness="1" Grid.Column="2" CornerRadius="4">
                                                <Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="3" Margin="0">
                                                    <Grid>
                                                        <ScrollViewer x:Name="PageScrollViewer" BorderThickness="0" HorizontalScrollBarVisibility="Auto" Visibility="Visible" VerticalScrollBarVisibility="Visible">
                                                            <Border x:Name="PageBorder" BorderBrush="DarkGray" BorderThickness="1" Background="White" Height="{Binding PageHeight}" Margin="10" Width="{Binding PageWidth}">
                                                                <telerik:LayoutTransformControl x:Name="PageContainer" Content="{Binding PageRoot}" IsTabStop="False" LayoutTransform="{Binding PageTransform}"/>
                                                            </Border>
                                                        </ScrollViewer>
                                                        <my:DialogBox x:Name="ViewerProgressMessage">
                                                            <my:DialogBox.Visibility>
                                                                <Binding Path="IsInProgress">
                                                                    <Binding.Converter>
                                                                        <my:VisibilityConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </my:DialogBox.Visibility>
                                                            <Grid Margin="20">
                                                                <Grid.RowDefinitions>
                                                                    <RowDefinition/>
                                                                    <RowDefinition Height="Auto"/>
                                                                </Grid.RowDefinitions>
                                                                <TextBlock HorizontalAlignment="Center" Text="{Binding ProgressMessage}" VerticalAlignment="Center"/>
                                                                <telerik:RadProgressBar Grid.Row="1">
                                                                    <telerik:RadProgressBar.Style>
                                                                        <Style TargetType="{x:Type telerik: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>
                                                                    </telerik:RadProgressBar.Style>
                                                                    <telerik:StyleManager.Theme>
                                                                        <telerik:Office_BlackTheme/>
                                                                    </telerik:StyleManager.Theme>
                                                                </telerik:RadProgressBar>
                                                            </Grid>
                                                        </my:DialogBox>
                                                        <TextBox x:Name="ViewerError" BorderThickness="0" Background="White" Foreground="Gray" FontFamily="Verdana" HorizontalAlignment="Stretch" IsReadOnly="True" Padding="20" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding Error}" VerticalAlignment="Stretch">
                                                            <TextBox.Visibility>
                                                                <Binding Path="HasError">
                                                                    <Binding.Converter>
                                                                        <my:VisibilityConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </TextBox.Visibility>
                                                        </TextBox>
                                                        <my:DialogBox x:Name="ExportDialog">
                                                            <my:DialogBox.Visibility>
                                                                <Binding Path="ShowExportDialog">
                                                                    <Binding.Converter>
                                                                        <my:VisibilityConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </my:DialogBox.Visibility>
                                                            <Grid Height="120" Width="300">
                                                                <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                                                    <Grid.RowDefinitions>
                                                                        <RowDefinition Height="70"/>
                                                                        <RowDefinition Height="50"/>
                                                                    </Grid.RowDefinitions>
                                                                    <StackPanel Orientation="Vertical" Grid.Row="0" VerticalAlignment="Bottom">
                                                                        <TextBlock FontWeight="Bold" HorizontalAlignment="Center" Text="{Binding ExportProgress}"/>
                                                                        <telerik:RadProgressBar x:Name="ExportProgressBar" HorizontalAlignment="Center" Width="260">
                                                                            <telerik:RadProgressBar.Style>
                                                                                <Style TargetType="{x:Type telerik: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>
                                                                            </telerik:RadProgressBar.Style>
                                                                            <telerik:StyleManager.Theme>
                                                                                <telerik:Office_BlackTheme/>
                                                                            </telerik:StyleManager.Theme>
                                                                        </telerik:RadProgressBar>
                                                                    </StackPanel>
                                                                    <telerik:RadButton Content="Cancel" Command="{Binding CancelExportCommand}" Grid.Row="2" VerticalAlignment="Center" Width="100">
                                                                        <telerik:StyleManager.Theme>
                                                                            <telerik:Office_BlackTheme/>
                                                                        </telerik:StyleManager.Theme>
                                                                    </telerik:RadButton>
                                                                </Grid>
                                                            </Grid>
                                                        </my: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">
                                                <telerik:RadSlider HandlesVisibility="Visible" Maximum="100" Minimum="-100" SmallChange="10" VerticalAlignment="Center" Width="200">
                                                    <telerik:StyleManager.Theme>
                                                        <telerik:Office_BlackTheme/>
                                                    </telerik:StyleManager.Theme>
                                                    <telerik:RadSlider.Value>
                                                        <Binding Mode="TwoWay" Path="Zoom">
                                                            <Binding.Converter>
                                                                <my:ScaleFactorConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </telerik:RadSlider.Value>
                                                </telerik:RadSlider>
                                                <telerik:RadComboBox IsTabStop="False">
                                                    <telerik:RadComboBox.Style>
                                                        <Style TargetType="{x:Type telerik:RadComboBox}">
                                                            <Setter Property="Margin" Value="10,0,3,0"/>
                                                            <Setter Property="Width" Value="70"/>
                                                            <Setter Property="HorizontalAlignment" Value="Center"/>
                                                            <Setter Property="VerticalAlignment" Value="Center"/>
                                                            <Setter Property="IsEditable" Value="True"/>
                                                            <Setter Property="IsTextSearchEnabled" Value="False"/>
                                                            <Setter Property="MaxDropDownHeight" Value="300"/>
                                                            <Setter Property="ItemsSource">
                                                                <Setter.Value>
                                                                    <Binding Path="AvailableZoomValues">
                                                                        <Binding.Converter>
                                                                            <my:ZoomConverter/>
                                                                        </Binding.Converter>
                                                                    </Binding>
                                                                </Setter.Value>
                                                            </Setter>
                                                            <Setter Property="Text">
                                                                <Setter.Value>
                                                                    <Binding Mode="TwoWay" Path="Zoom">
                                                                        <Binding.Converter>
                                                                            <my:ZoomConverter/>
                                                                        </Binding.Converter>
                                                                    </Binding>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Style>
                                                    </telerik:RadComboBox.Style>
                                                    <telerik:StyleManager.Theme>
                                                        <telerik:Office_BlackTheme/>
                                                    </telerik:StyleManager.Theme>
                                                    <telerik:RadComboBox.Template>
                                                        <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                                                            <Grid x:Name="VisualRoot">
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition Width="*"/>
                                                                    <ColumnDefinition Width="Auto"/>
                                                                </Grid.ColumnDefinitions>
                                                                <Border x:Name="Background" Background="White" Grid.Column="0" CornerRadius="1,0,0,1" IsHitTestVisible="False"/>
                                                                <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                                                                <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                                                                <Border x:Name="MouseOverVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Opacity="0" Visibility="Collapsed"/>
                                                                <telerik:PickerTextBox x:Name="PART_EditableTextBox" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{TemplateBinding IsReadOnly}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                                                    <telerik:StyleManager.Theme>
                                                                        <telerik:Office_BlackTheme/>
                                                                    </telerik:StyleManager.Theme>
                                                                </telerik:PickerTextBox>
                                                                <Border x:Name="FocusVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Visibility="Collapsed">
                                                                    <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0"/>
                                                                </Border>
                                                                <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" Margin="0" Padding="0">
                                                                    <telerik:RadToggleButton.Template>
                                                                        <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                                                            <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                                                        </ControlTemplate>
                                                                    </telerik:RadToggleButton.Template>
                                                                    <Grid>
                                                                        <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,1,1,0" RenderMouseOver="{Binding IsMouseOver, ElementName=PART_DropDownButton}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderActive="{TemplateBinding IsMouseOver}" RenderEnabled="{TemplateBinding IsEnabled}">
                                                                            <telerik:StyleManager.Theme>
                                                                                <telerik:Office_BlackTheme/>
                                                                            </telerik:StyleManager.Theme>
                                                                        </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                                                        <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                                                            <ContentControl.Template>
                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                    <Grid Margin="5,0">
                                                                                        <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                                                        <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                                                                    </Grid>
                                                                                </ControlTemplate>
                                                                            </ContentControl.Template>
                                                                        </ContentControl>
                                                                    </Grid>
                                                                </telerik:RadToggleButton>
                                                                <TextBlock x:Name="Watermark" HorizontalAlignment="Left" IsHitTestVisible="False" Margin="5,0,0,0" Opacity="0.5" Text="{TemplateBinding EmptyText}" Visibility="Collapsed" VerticalAlignment="Center"/>
                                                                <Popup x:Name="PART_Popup" AllowsTransparency="True" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
                                                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                                                        <Grid>
                                                                            <Grid.RowDefinitions>
                                                                                <RowDefinition Height="Auto"/>
                                                                                <RowDefinition Height="*"/>
                                                                            </Grid.RowDefinitions>
                                                                            <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                                                                <telerik:StyleManager.Theme>
                                                                                    <telerik:Office_BlackTheme/>
                                                                                </telerik:StyleManager.Theme>
                                                                            </telerik:RadButton>
                                                                            <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Padding="1,1,1,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                                                                <telerik:StyleManager.Theme>
                                                                                    <telerik:Office_BlackTheme/>
                                                                                </telerik:StyleManager.Theme>
                                                                                <ItemsPresenter/>
                                                                            </ScrollViewer>
                                                                        </Grid>
                                                                    </Border>
                                                                </Popup>
                                                            </Grid>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsEnabled" Value="False">
                                                                    <Setter Property="BorderBrush" TargetName="Border" Value="#FF989898"/>
                                                                    <Setter Property="Foreground" TargetName="PART_EditableTextBox" Value="#FF8D8D8D"/>
                                                                    <Setter Property="Foreground" TargetName="DropDownIcon" Value="#FF8D8D8D"/>
                                                                    <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                                                                    <Setter Property="BorderBrush" TargetName="Border" Value="#FF989898"/>
                                                                    <Setter Property="Background" TargetName="Background" Value="#FFE0E0E0"/>
                                                                </Trigger>
                                                                <Trigger Property="IsWatermarkVisible" Value="True">
                                                                    <Setter Property="Visibility" TargetName="Watermark" Value="Visible"/>
                                                                </Trigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsEnabled" Value="True"/>
                                                                        <Condition Property="IsMouseOver" Value="True"/>
                                                                    </MultiTrigger.Conditions>
                                                                    <MultiTrigger.EnterActions>
                                                                        <BeginStoryboard>
                                                                            <Storyboard>
                                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                                                    <LinearDoubleKeyFrame KeyTime="0:0:0.115" Value="1"/>
                                                                                </DoubleAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Visible</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </BeginStoryboard>
                                                                    </MultiTrigger.EnterActions>
                                                                    <MultiTrigger.ExitActions>
                                                                        <BeginStoryboard>
                                                                            <Storyboard>
                                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                                                    <LinearDoubleKeyFrame KeyTime="0:0:0.15" Value="0"/>
                                                                                </DoubleAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0.15">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Collapsed</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </BeginStoryboard>
                                                                    </MultiTrigger.ExitActions>
                                                                    <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                                                                    <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                                                                </MultiTrigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsEnabled" Value="True"/>
                                                                        <Condition Property="IsDropDownOpen" Value="True"/>
                                                                    </MultiTrigger.Conditions>
                                                                    <Setter Property="BorderBrush" TargetName="Border">
                                                                        <Setter.Value>
                                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                <GradientStop Color="#FF282828"/>
                                                                                <GradientStop Color="#FF5F5F5F" Offset="1"/>
                                                                            </LinearGradientBrush>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                                                                    <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                                                                </MultiTrigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsKeyboardFocusWithin" Value="True"/>
                                                                        <Condition Property="IsDropDownOpen" Value="False"/>
                                                                    </MultiTrigger.Conditions>
                                                                    <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible"/>
                                                                </MultiTrigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </telerik:RadComboBox.Template>
                                                </telerik:RadComboBox>
                                            </StackPanel>
                                        </Grid>
                                    </Grid>
                                </Border>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ReportViewerStyle3" TargetType="{x:Type my:ReportViewer}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type my:ReportViewer}">
                        <Grid x:Name="LayoutRoot">
                            <Border BorderBrush="#3FFFFFFF" BorderThickness="1" CornerRadius="6">
                                <Border BorderBrush="Black" BorderThickness="1" CornerRadius="5" Margin="0" Padding="6">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FF373737" Offset="0"/>
                                            <GradientStop Color="Black" Offset="1"/>
                                            <GradientStop Color="Black" Offset="0.1"/>
                                        </LinearGradientBrush>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="6"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="6"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
                                        <telerik:RadToolBar Grid.Row="0">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                            <telerik:RadButton Command="{Binding NavigateBackCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NavBack.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadButton Command="{Binding NavigateForwardCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NavForward.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding RefreshReportCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Refresh.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding MoveToFirstPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/FirstPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadButton Command="{Binding MoveToPreviousPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/PrevPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik: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" VerticalAlignment="Center">
												<TextBlock.Text>
													<Binding ConverterParameter="of {0} pages" Path="PageCount">
														<Binding.Converter>
															<my:FormatedNumberConverter/>
														</Binding.Converter>
													</Binding>
												</TextBlock.Text>
                                            </TextBlock>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding MoveToNextPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/NextPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadButton Command="{Binding MoveToLastPageCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/LastPage.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadButton Command="{Binding PrintReportCommand}" Margin="0,2" Padding="2">
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Print.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadButton>
                                            <telerik:RadComboBox Height="24" IsEnabled="{Binding IsExportEnabled}" Margin="1,0" Padding="2,0" Width="45">
                                                <telerik:RadComboBox.EmptySelectionBoxTemplate>
                                                    <DataTemplate>
                                                        <Image HorizontalAlignment="Left" Height="16" Visibility="Visible" Width="16">
                                                            <Image.Source>
                                                                <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Export.png"/>
                                                            </Image.Source>
                                                        </Image>
                                                    </DataTemplate>
                                                </telerik:RadComboBox.EmptySelectionBoxTemplate>
                                                <telerik:RadComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock MinWidth="150" Text="{Binding Description}"/>
                                                    </DataTemplate>
                                                </telerik:RadComboBox.ItemTemplate>
                                                <telerik:RadComboBox.SelectionBoxTemplate>
                                                    <DataTemplate>
                                                        <Image HorizontalAlignment="Left" Height="16" Visibility="Visible" Width="16">
                                                            <Image.Source>
                                                                <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Export.png"/>
                                                            </Image.Source>
                                                        </Image>
                                                    </DataTemplate>
                                                </telerik:RadComboBox.SelectionBoxTemplate>
                                            </telerik:RadComboBox>
                                            <telerik:RadToolBarSeparator/>
                                            <telerik:RadToggleButton IsChecked="{Binding IsDocumentMapVisible, Mode=TwoWay}" Margin="0,2" Padding="2">
                                                <telerik:RadToggleButton.Visibility>
                                                    <Binding Path="HasDocumentMap">
                                                        <Binding.Converter>
                                                            <my:VisibilityConverter/>
                                                        </Binding.Converter>
                                                    </Binding>
                                                </telerik:RadToggleButton.Visibility>
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/DocumentMap.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadToggleButton>
                                            <telerik:RadToggleButton IsChecked="{Binding IsParametersAreaVisible, Mode=TwoWay}" Margin="0,2" Padding="2">
                                                <telerik:RadToggleButton.Visibility>
                                                    <Binding Path="HasParameters">
                                                        <Binding.Converter>
                                                            <my:VisibilityConverter/>
                                                        </Binding.Converter>
                                                    </Binding>
                                                </telerik:RadToggleButton.Visibility>
                                                <Image Height="16" Width="16">
                                                    <Image.Source>
                                                        <BitmapImage UriSource="pack://application:,,,/Telerik.ReportViewer.Wpf;component/images/Parameters.png"/>
                                                    </Image.Source>
                                                </Image>
                                            </telerik:RadToggleButton>
                                        </telerik:RadToolBar>
                                        <Border x:Name="ParametersAreaPane" Grid.Row="1">
                                            <Border.Visibility>
                                                <Binding Path="IsParametersAreaVisible">
                                                    <Binding.Converter>
                                                        <my:VisibilityConverter/>
                                                    </Binding.Converter>
                                                </Binding>
                                            </Border.Visibility>
                                            <Grid>
                                                <Grid>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                    </Grid.ColumnDefinitions>
                                                    <Grid Grid.Column="0">
                                                        <my:ReportParametersControl Foreground="White">
                                                            <my:ReportParametersControl.ItemsPanel>
                                                                <ItemsPanelTemplate>
                                                                    <telerik:RadUniformGrid Columns="2" IsItemsHost="True"/>
                                                                </ItemsPanelTemplate>
                                                            </my:ReportParametersControl.ItemsPanel>
                                                            <my:ReportParametersControl.ParameterTemplateSelector>
                                                                <my:ReportParameterEditorTemplateSelector>
                                                                    <my:ReportParameterEditorTemplateSelector.Templates>
                                                                        <DataTemplate>
                                                                            <my:ParameterContentControl AvailableValues="False" Multivalue="False" Type="System.Boolean">
                                                                                <my:ParameterContentControl.Style>
                                                                                    <Style TargetType="{x:Type ContentControl}">
                                                                                        <Setter Property="Template">
                                                                                            <Setter.Value>
                                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                                    <Grid Height="30" Margin="5">
                                                                                                        <Grid.ColumnDefinitions>
                                                                                                            <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                        </Grid.ColumnDefinitions>
                                                                                                        <TextBlock Grid.Column="0" Foreground="White" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
                                                                                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="5,0" VerticalAlignment="Center"/>
                                                                                                        <CheckBox Content="Null" Grid.Column="2" Foreground="White" IsChecked="{Binding IsNull, Mode=TwoWay}" VerticalAlignment="Center">
                                                                                                            <CheckBox.Visibility>
                                                                                                                <Binding Path="AllowNull">
                                                                                                                    <Binding.Converter>
                                                                                                                        <my:VisibilityConverter/>
                                                                                                                    </Binding.Converter>
                                                                                                                </Binding>
                                                                                                            </CheckBox.Visibility>
                                                                                                        </CheckBox>
                                                                                                    </Grid>
                                                                                                </ControlTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </Style>
                                                                                </my:ParameterContentControl.Style>
                                                                                <CheckBox IsChecked="{Binding Value, Mode=TwoWay}"/>
                                                                            </my:ParameterContentControl>
                                                                        </DataTemplate>
                                                                        <DataTemplate>
                                                                            <my:ParameterContentControl AvailableValues="True" Multivalue="True" Type="{x:Null}">
                                                                                <my:ParameterContentControl.Style>
                                                                                    <Style TargetType="{x:Type ContentControl}">
                                                                                        <Setter Property="Template">
                                                                                            <Setter.Value>
                                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                                    <Grid Height="30" Margin="5">
                                                                                                        <Grid.ColumnDefinitions>
                                                                                                            <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                        </Grid.ColumnDefinitions>
                                                                                                        <TextBlock Grid.Column="0" Foreground="White" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
                                                                                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="5,0" VerticalAlignment="Center"/>
                                                                                                        <CheckBox Content="Null" Grid.Column="2" Foreground="White" IsChecked="{Binding IsNull, Mode=TwoWay}" VerticalAlignment="Center">
                                                                                                            <CheckBox.Visibility>
                                                                                                                <Binding Path="AllowNull">
                                                                                                                    <Binding.Converter>
                                                                                                                        <my:VisibilityConverter/>
                                                                                                                    </Binding.Converter>
                                                                                                                </Binding>
                                                                                                            </CheckBox.Visibility>
                                                                                                        </CheckBox>
                                                                                                    </Grid>
                                                                                                </ControlTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </Style>
                                                                                </my:ParameterContentControl.Style>
                                                                                <telerik:RadComboBox CanAutocompleteSelectItems="False" CanKeyboardNavigationSelectItems="False" IsDropDownOpen="{Binding IsDropDownOpen, Mode=TwoWay}" IsTextSearchEnabled="False" Width="200">
                                                                                    <telerik:RadComboBox.ItemTemplate>
                                                                                        <DataTemplate>
                                                                                            <CheckBox Content="{Binding Name}" IsChecked="{Binding IsSelected, Mode=TwoWay}"/>
                                                                                        </DataTemplate>
                                                                                    </telerik:RadComboBox.ItemTemplate>
                                                                                    <telerik:RadComboBox.SelectionBoxTemplate>
                                                                                        <DataTemplate>
                                                                                            <TextBlock HorizontalAlignment="Stretch">
																								<TextBlock.Text>
																									<Binding Mode="OneWay" Path="Owner.SelectedLabels">
																										<Binding.Converter>
																											<my:MultivalueParameterConverter/>
																										</Binding.Converter>
																									</Binding>
																								</TextBlock.Text>
                                                                                            </TextBlock>
                                                                                        </DataTemplate>
                                                                                    </telerik:RadComboBox.SelectionBoxTemplate>
                                                                                    <telerik:StyleManager.Theme>
                                                                                        <telerik:Office_BlackTheme/>
                                                                                    </telerik:StyleManager.Theme>
                                                                                </telerik:RadComboBox>
                                                                            </my:ParameterContentControl>
                                                                        </DataTemplate>
                                                                        <DataTemplate>
                                                                            <my:ParameterContentControl AvailableValues="False" Multivalue="True" Type="{x:Null}">
                                                                                <my:ParameterContentControl.Style>
                                                                                    <Style TargetType="{x:Type ContentControl}">
                                                                                        <Setter Property="Template">
                                                                                            <Setter.Value>
                                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                                    <Grid Height="30" Margin="5">
                                                                                                        <Grid.ColumnDefinitions>
                                                                                                            <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                        </Grid.ColumnDefinitions>
                                                                                                        <TextBlock Grid.Column="0" Foreground="White" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
                                                                                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="5,0" VerticalAlignment="Center"/>
                                                                                                        <CheckBox Content="Null" Grid.Column="2" Foreground="White" IsChecked="{Binding IsNull, Mode=TwoWay}" VerticalAlignment="Center">
                                                                                                            <CheckBox.Visibility>
                                                                                                                <Binding Path="AllowNull">
                                                                                                                    <Binding.Converter>
                                                                                                                        <my:VisibilityConverter/>
                                                                                                                    </Binding.Converter>
                                                                                                                </Binding>
                                                                                                            </CheckBox.Visibility>
                                                                                                        </CheckBox>
                                                                                                    </Grid>
                                                                                                </ControlTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </Style>
                                                                                </my:ParameterContentControl.Style>
                                                                                <TextBox Width="200">
                                                                                    <Binding Mode="TwoWay" NotifyOnValidationError="True" Path="Value" ValidatesOnExceptions="True">
                                                                                        <Binding.Converter>
                                                                                            <my:MultivalueParameterConverter/>
                                                                                        </Binding.Converter>
                                                                                    </Binding>
                                                                                </TextBox>
                                                                            </my:ParameterContentControl>
                                                                        </DataTemplate>
                                                                        <DataTemplate>
                                                                            <my:ParameterContentControl AvailableValues="True" Multivalue="False" Type="{x:Null}">
                                                                                <my:ParameterContentControl.Style>
                                                                                    <Style TargetType="{x:Type ContentControl}">
                                                                                        <Setter Property="Template">
                                                                                            <Setter.Value>
                                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                                    <Grid Height="30" Margin="5">
                                                                                                        <Grid.ColumnDefinitions>
                                                                                                            <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                        </Grid.ColumnDefinitions>
                                                                                                        <TextBlock Grid.Column="0" Foreground="White" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
                                                                                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="5,0" VerticalAlignment="Center"/>
                                                                                                        <CheckBox Content="Null" Grid.Column="2" Foreground="White" IsChecked="{Binding IsNull, Mode=TwoWay}" VerticalAlignment="Center">
                                                                                                            <CheckBox.Visibility>
                                                                                                                <Binding Path="AllowNull">
                                                                                                                    <Binding.Converter>
                                                                                                                        <my:VisibilityConverter/>
                                                                                                                    </Binding.Converter>
                                                                                                                </Binding>
                                                                                                            </CheckBox.Visibility>
                                                                                                        </CheckBox>
                                                                                                    </Grid>
                                                                                                </ControlTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </Style>
                                                                                </my:ParameterContentControl.Style>
                                                                                <telerik:RadComboBox Width="200">
                                                                                    <telerik:RadComboBox.ItemTemplate>
                                                                                        <DataTemplate>
                                                                                            <TextBlock Text="{Binding Name}"/>
                                                                                        </DataTemplate>
                                                                                    </telerik:RadComboBox.ItemTemplate>
                                                                                    <telerik:StyleManager.Theme>
                                                                                        <telerik:Office_BlackTheme/>
                                                                                    </telerik:StyleManager.Theme>
                                                                                </telerik:RadComboBox>
                                                                            </my:ParameterContentControl>
                                                                        </DataTemplate>
                                                                        <DataTemplate>
                                                                            <my:ParameterContentControl AvailableValues="False" Multivalue="False" Type="System.DateTime">
                                                                                <my:ParameterContentControl.Style>
                                                                                    <Style TargetType="{x:Type ContentControl}">
                                                                                        <Setter Property="Template">
                                                                                            <Setter.Value>
                                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                                    <Grid Height="30" Margin="5">
                                                                                                        <Grid.ColumnDefinitions>
                                                                                                            <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                        </Grid.ColumnDefinitions>
                                                                                                        <TextBlock Grid.Column="0" Foreground="White" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
                                                                                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="5,0" VerticalAlignment="Center"/>
                                                                                                        <CheckBox Content="Null" Grid.Column="2" Foreground="White" IsChecked="{Binding IsNull, Mode=TwoWay}" VerticalAlignment="Center">
                                                                                                            <CheckBox.Visibility>
                                                                                                                <Binding Path="AllowNull">
                                                                                                                    <Binding.Converter>
                                                                                                                        <my:VisibilityConverter/>
                                                                                                                    </Binding.Converter>
                                                                                                                </Binding>
                                                                                                            </CheckBox.Visibility>
                                                                                                        </CheckBox>
                                                                                                    </Grid>
                                                                                                </ControlTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </Style>
                                                                                </my:ParameterContentControl.Style>
                                                                                <telerik:RadDatePicker DateTimeWatermarkContent="Enter date" DisplayDate="2011-01-01" InputMode="DatePicker" SelectedDate="{Binding Value, Mode=TwoWay}" Width="200">
                                                                                    <telerik:StyleManager.Theme>
                                                                                        <telerik:Office_BlackTheme/>
                                                                                    </telerik:StyleManager.Theme>
                                                                                </telerik:RadDatePicker>
                                                                            </my:ParameterContentControl>
                                                                        </DataTemplate>
                                                                        <DataTemplate>
                                                                            <my:ParameterContentControl AvailableValues="False" Multivalue="False" Type="{x:Null}">
                                                                                <my:ParameterContentControl.Style>
                                                                                    <Style TargetType="{x:Type ContentControl}">
                                                                                        <Setter Property="Template">
                                                                                            <Setter.Value>
                                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                                    <Grid Height="30" Margin="5">
                                                                                                        <Grid.ColumnDefinitions>
                                                                                                            <ColumnDefinition MinWidth="100" Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                            <ColumnDefinition Width="Auto"/>
                                                                                                        </Grid.ColumnDefinitions>
                                                                                                        <TextBlock Grid.Column="0" Foreground="White" HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding Text}" VerticalAlignment="Center"/>
                                                                                                        <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" ContentStringFormat="{TemplateBinding ContentStringFormat}" Margin="5,0" VerticalAlignment="Center"/>
                                                                                                        <CheckBox Content="Null" Grid.Column="2" Foreground="White" IsChecked="{Binding IsNull, Mode=TwoWay}" VerticalAlignment="Center">
                                                                                                            <CheckBox.Visibility>
                                                                                                                <Binding Path="AllowNull">
                                                                                                                    <Binding.Converter>
                                                                                                                        <my:VisibilityConverter/>
                                                                                                                    </Binding.Converter>
                                                                                                                </Binding>
                                                                                                            </CheckBox.Visibility>
                                                                                                        </CheckBox>
                                                                                                    </Grid>
                                                                                                </ControlTemplate>
                                                                                            </Setter.Value>
                                                                                        </Setter>
                                                                                    </Style>
                                                                                </my:ParameterContentControl.Style>
                                                                                <TextBox Text="{Binding Value, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}" Width="200"/>
                                                                            </my:ParameterContentControl>
                                                                        </DataTemplate>
                                                                    </my:ReportParameterEditorTemplateSelector.Templates>
                                                                </my:ReportParameterEditorTemplateSelector>
                                                            </my:ReportParametersControl.ParameterTemplateSelector>
                                                        </my:ReportParametersControl>
                                                    </Grid>
                                                    <Grid Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                                                        <telerik:RadButton Content="Preview" Command="{Binding PreviewReportCommand}" Margin="3" Padding="10,3">
                                                            <telerik:StyleManager.Theme>
                                                                <telerik:Office_BlackTheme/>
                                                            </telerik:StyleManager.Theme>
                                                        </telerik:RadButton>
                                                    </Grid>
                                                </Grid>
                                                <my:DialogBox x:Name="UpdateParametersDialog">
                                                    <my:DialogBox.Visibility>
                                                        <Binding Path="IsUpdatingParameters">
                                                            <Binding.Converter>
                                                                <my:VisibilityConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </my:DialogBox.Visibility>
                                                    <Grid Margin="20">
                                                        <Grid.RowDefinitions>
                                                            <RowDefinition/>
                                                            <RowDefinition Height="Auto"/>
                                                        </Grid.RowDefinitions>
                                                        <TextBlock HorizontalAlignment="Center" Text="{Binding UpdateParametersProgress}" VerticalAlignment="Center"/>
                                                        <telerik:RadProgressBar Grid.Row="1">
                                                            <telerik:RadProgressBar.Style>
                                                                <Style TargetType="{x:Type telerik: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>
                                                            </telerik:RadProgressBar.Style>
                                                            <telerik:StyleManager.Theme>
                                                                <telerik:Office_BlackTheme/>
                                                            </telerik:StyleManager.Theme>
                                                        </telerik:RadProgressBar>
                                                    </Grid>
                                                </my:DialogBox>
                                            </Grid>
                                        </Border>
                                        <Grid Grid.Row="3">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="*"/>
                                            </Grid.ColumnDefinitions>
                                            <Border x:Name="DocumentMapPane" Grid.Column="0" Width="200">
                                                <Border.Visibility>
                                                    <Binding Path="IsDocumentMapVisible">
                                                        <Binding.Converter>
                                                            <my:VisibilityConverter/>
                                                        </Binding.Converter>
                                                    </Binding>
                                                </Border.Visibility>
                                                <Border BorderBrush="#66FFFFFF" BorderThickness="1" Grid.Column="2" CornerRadius="4" Margin="0,0,6,0">
                                                    <Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="3" Margin="0">
                                                        <telerik:RadTreeView x:Name="DocumentMapTreeView" Background="White" ScrollViewer.HorizontalScrollBarVisibility="Auto" IsVirtualizing="False" ScrollViewer.VerticalScrollBarVisibility="Auto">
                                                            <telerik:RadTreeView.ItemTemplate>
                                                                <HierarchicalDataTemplate AlternationCount="0" ItemBindingGroup="{x:Null}" ItemTemplate="{x:Null}" ItemContainerStyleSelector="{x:Null}" ItemStringFormat="{x:Null}" ItemsSource="{Binding Children}" ItemContainerStyle="{x:Null}" ItemTemplateSelector="{x:Null}">
                                                                    <TextBlock Text="{Binding Text}"/>
                                                                </HierarchicalDataTemplate>
                                                            </telerik:RadTreeView.ItemTemplate>
                                                            <telerik:RadTreeView.ItemContainerStyle>
                                                                <Style TargetType="{x:Type telerik:RadTreeViewItem}">
                                                                    <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/>
                                                                </Style>
                                                            </telerik:RadTreeView.ItemContainerStyle>
                                                            <telerik:RadTreeView.Style>
                                                                <Style TargetType="{x:Type telerik:RadTreeView}">
                                                                    <Setter Property="IsEnabled" Value="{Binding IsMoveToPageEnabled}"/>
                                                                    <Setter Property="SelectedItem" Value="{Binding SelectedDocumentMapNode, Mode=TwoWay}"/>
                                                                    <Setter Property="ItemsSource" Value="{Binding DocumentMapNodes}"/>
                                                                </Style>
                                                            </telerik:RadTreeView.Style>
                                                            <telerik:StyleManager.Theme>
                                                                <telerik:Office_BlackTheme/>
                                                            </telerik:StyleManager.Theme>
                                                        </telerik:RadTreeView>
                                                    </Border>
                                                </Border>
                                            </Border>
                                            <Border BorderBrush="#66FFFFFF" BorderThickness="1" Grid.Column="2" CornerRadius="4">
                                                <Border BorderBrush="Black" BorderThickness="1" Background="White" CornerRadius="3" Margin="0">
                                                    <Grid>
                                                        <ScrollViewer x:Name="PageScrollViewer" BorderThickness="0" HorizontalScrollBarVisibility="Auto" Visibility="Visible" VerticalScrollBarVisibility="Visible">
                                                            <Border x:Name="PageBorder" BorderBrush="DarkGray" BorderThickness="1" Background="White" Height="{Binding PageHeight}" Margin="10" Width="{Binding PageWidth}">
                                                                <telerik:LayoutTransformControl x:Name="PageContainer" Content="{Binding PageRoot}" IsTabStop="False" LayoutTransform="{Binding PageTransform}"/>
                                                            </Border>
                                                        </ScrollViewer>
                                                        <my:DialogBox x:Name="ViewerProgressMessage">
                                                            <my:DialogBox.Visibility>
                                                                <Binding Path="IsInProgress">
                                                                    <Binding.Converter>
                                                                        <my:VisibilityConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </my:DialogBox.Visibility>
                                                            <Grid Margin="20">
                                                                <Grid.RowDefinitions>
                                                                    <RowDefinition/>
                                                                    <RowDefinition Height="Auto"/>
                                                                </Grid.RowDefinitions>
                                                                <TextBlock HorizontalAlignment="Center" Text="{Binding ProgressMessage}" VerticalAlignment="Center"/>
                                                                <telerik:RadProgressBar Grid.Row="1">
                                                                    <telerik:RadProgressBar.Style>
                                                                        <Style TargetType="{x:Type telerik: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>
                                                                    </telerik:RadProgressBar.Style>
                                                                    <telerik:StyleManager.Theme>
                                                                        <telerik:Office_BlackTheme/>
                                                                    </telerik:StyleManager.Theme>
                                                                </telerik:RadProgressBar>
                                                            </Grid>
                                                        </my:DialogBox>
                                                        <TextBox x:Name="ViewerError" BorderThickness="0" Background="White" Foreground="Gray" FontFamily="Verdana" HorizontalAlignment="Stretch" IsReadOnly="True" Padding="20" TextAlignment="Center" TextWrapping="Wrap" Text="{Binding Error}" VerticalAlignment="Stretch">
                                                            <TextBox.Visibility>
                                                                <Binding Path="HasError">
                                                                    <Binding.Converter>
                                                                        <my:VisibilityConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </TextBox.Visibility>
                                                        </TextBox>
                                                        <my:DialogBox x:Name="ExportDialog">
                                                            <my:DialogBox.Visibility>
                                                                <Binding Path="ShowExportDialog">
                                                                    <Binding.Converter>
                                                                        <my:VisibilityConverter/>
                                                                    </Binding.Converter>
                                                                </Binding>
                                                            </my:DialogBox.Visibility>
                                                            <Grid Height="120" Width="300">
                                                                <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                                                    <Grid.RowDefinitions>
                                                                        <RowDefinition Height="70"/>
                                                                        <RowDefinition Height="50"/>
                                                                    </Grid.RowDefinitions>
                                                                    <StackPanel Orientation="Vertical" Grid.Row="0" VerticalAlignment="Bottom">
                                                                        <TextBlock FontWeight="Bold" HorizontalAlignment="Center" Text="{Binding ExportProgress}"/>
                                                                        <telerik:RadProgressBar x:Name="ExportProgressBar" HorizontalAlignment="Center" Width="260">
                                                                            <telerik:RadProgressBar.Style>
                                                                                <Style TargetType="{x:Type telerik: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>
                                                                            </telerik:RadProgressBar.Style>
                                                                            <telerik:StyleManager.Theme>
                                                                                <telerik:Office_BlackTheme/>
                                                                            </telerik:StyleManager.Theme>
                                                                        </telerik:RadProgressBar>
                                                                    </StackPanel>
                                                                    <telerik:RadButton Content="Cancel" Command="{Binding CancelExportCommand}" Grid.Row="2" VerticalAlignment="Center" Width="100">
                                                                        <telerik:StyleManager.Theme>
                                                                            <telerik:Office_BlackTheme/>
                                                                        </telerik:StyleManager.Theme>
                                                                    </telerik:RadButton>
                                                                </Grid>
                                                            </Grid>
                                                        </my: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">
                                                <telerik:RadSlider HandlesVisibility="Visible" Maximum="100" Minimum="-100" SmallChange="10" VerticalAlignment="Center" Width="200">
                                                    <telerik:StyleManager.Theme>
                                                        <telerik:Office_BlackTheme/>
                                                    </telerik:StyleManager.Theme>
                                                    <telerik:RadSlider.Value>
                                                        <Binding Mode="TwoWay" Path="Zoom">
                                                            <Binding.Converter>
                                                                <my:ScaleFactorConverter/>
                                                            </Binding.Converter>
                                                        </Binding>
                                                    </telerik:RadSlider.Value>
                                                </telerik:RadSlider>
                                                <telerik:RadComboBox IsTabStop="False">
                                                    <telerik:RadComboBox.Style>
                                                        <Style TargetType="{x:Type telerik:RadComboBox}">
                                                            <Setter Property="Margin" Value="10,0,3,0"/>
                                                            <Setter Property="Width" Value="70"/>
                                                            <Setter Property="HorizontalAlignment" Value="Center"/>
                                                            <Setter Property="VerticalAlignment" Value="Center"/>
                                                            <Setter Property="IsEditable" Value="True"/>
                                                            <Setter Property="IsTextSearchEnabled" Value="False"/>
                                                            <Setter Property="MaxDropDownHeight" Value="300"/>
                                                            <Setter Property="ItemsSource">
                                                                <Setter.Value>
                                                                    <Binding Path="AvailableZoomValues">
                                                                        <Binding.Converter>
                                                                            <my:ZoomConverter/>
                                                                        </Binding.Converter>
                                                                    </Binding>
                                                                </Setter.Value>
                                                            </Setter>
                                                            <Setter Property="Text">
                                                                <Setter.Value>
                                                                    <Binding Mode="TwoWay" Path="Zoom">
                                                                        <Binding.Converter>
                                                                            <my:ZoomConverter/>
                                                                        </Binding.Converter>
                                                                    </Binding>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Style>
                                                    </telerik:RadComboBox.Style>
                                                    <telerik:StyleManager.Theme>
                                                        <telerik:Office_BlackTheme/>
                                                    </telerik:StyleManager.Theme>
                                                    <telerik:RadComboBox.Template>
                                                        <ControlTemplate TargetType="{x:Type telerik:RadComboBox}">
                                                            <Grid x:Name="VisualRoot">
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition Width="*"/>
                                                                    <ColumnDefinition Width="Auto"/>
                                                                </Grid.ColumnDefinitions>
                                                                <Border x:Name="Background" Background="White" Grid.Column="0" CornerRadius="1,0,0,1" IsHitTestVisible="False"/>
                                                                <Border Background="{TemplateBinding Background}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                                                                <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False"/>
                                                                <Border x:Name="MouseOverVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Opacity="0" Visibility="Collapsed"/>
                                                                <telerik:PickerTextBox x:Name="PART_EditableTextBox" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsReadOnly="{TemplateBinding IsReadOnly}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
                                                                    <telerik:StyleManager.Theme>
                                                                        <telerik:Office_BlackTheme/>
                                                                    </telerik:StyleManager.Theme>
                                                                </telerik:PickerTextBox>
                                                                <Border x:Name="FocusVisual" BorderBrush="#FFFFC92B" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" CornerRadius="1" IsHitTestVisible="False" Visibility="Collapsed">
                                                                    <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0"/>
                                                                </Border>
                                                                <telerik:RadToggleButton x:Name="PART_DropDownButton" ClickMode="Press" Grid.Column="1" IsTabStop="False" Margin="0" Padding="0">
                                                                    <telerik:RadToggleButton.Template>
                                                                        <ControlTemplate TargetType="{x:Type telerik:RadToggleButton}">
                                                                            <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                                                        </ControlTemplate>
                                                                    </telerik:RadToggleButton.Template>
                                                                    <Grid>
                                                                        <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0,1,1,0" RenderMouseOver="{Binding IsMouseOver, ElementName=PART_DropDownButton}" RenderPressed="{TemplateBinding IsDropDownOpen}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderActive="{TemplateBinding IsMouseOver}" RenderEnabled="{TemplateBinding IsEnabled}">
                                                                            <telerik:StyleManager.Theme>
                                                                                <telerik:Office_BlackTheme/>
                                                                            </telerik:StyleManager.Theme>
                                                                        </Telerik_Windows_Controls_Chromes:ButtonChrome>
                                                                        <ContentControl x:Name="DropDownIcon" Background="White" Grid.Column="1" Foreground="Black" IsTabStop="False">
                                                                            <ContentControl.Template>
                                                                                <ControlTemplate TargetType="{x:Type ContentControl}">
                                                                                    <Grid Margin="5,0">
                                                                                        <Path x:Name="BackgroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Background}" Height="3" Margin="0,2,0,0" Stretch="Fill" Width="5"/>
                                                                                        <Path x:Name="ForegroundIcon" Data="M0,0L2,0 1,1z" Fill="{TemplateBinding Foreground}" Height="3" Margin="0,1" Stretch="Fill" Width="5"/>
                                                                                    </Grid>
                                                                                </ControlTemplate>
                                                                            </ContentControl.Template>
                                                                        </ContentControl>
                                                                    </Grid>
                                                                </telerik:RadToggleButton>
                                                                <TextBlock x:Name="Watermark" HorizontalAlignment="Left" IsHitTestVisible="False" Margin="5,0,0,0" Opacity="0.5" Text="{TemplateBinding EmptyText}" Visibility="Collapsed" VerticalAlignment="Center"/>
                                                                <Popup x:Name="PART_Popup" AllowsTransparency="True" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
                                                                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White" CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}">
                                                                        <Grid>
                                                                            <Grid.RowDefinitions>
                                                                                <RowDefinition Height="Auto"/>
                                                                                <RowDefinition Height="*"/>
                                                                            </Grid.RowDefinitions>
                                                                            <telerik:RadButton x:Name="PART_ClearButton" Content="{TemplateBinding ClearSelectionButtonContent}" Margin="-1,-1,-1,0" Grid.Row="0" Visibility="{TemplateBinding ClearSelectionButtonVisibility}">
                                                                                <telerik:StyleManager.Theme>
                                                                                    <telerik:Office_BlackTheme/>
                                                                                </telerik:StyleManager.Theme>
                                                                            </telerik:RadButton>
                                                                            <ScrollViewer x:Name="PART_ScrollViewer" BorderThickness="0" CanContentScroll="True" Padding="1,1,1,0" Grid.Row="1" VerticalScrollBarVisibility="Auto">
                                                                                <telerik:StyleManager.Theme>
                                                                                    <telerik:Office_BlackTheme/>
                                                                                </telerik:StyleManager.Theme>
                                                                                <ItemsPresenter/>
                                                                            </ScrollViewer>
                                                                        </Grid>
                                                                    </Border>
                                                                </Popup>
                                                            </Grid>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsEnabled" Value="False">
                                                                    <Setter Property="BorderBrush" TargetName="Border" Value="#FF989898"/>
                                                                    <Setter Property="Foreground" TargetName="PART_EditableTextBox" Value="#FF8D8D8D"/>
                                                                    <Setter Property="Foreground" TargetName="DropDownIcon" Value="#FF8D8D8D"/>
                                                                    <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                                                                    <Setter Property="BorderBrush" TargetName="Border" Value="#FF989898"/>
                                                                    <Setter Property="Background" TargetName="Background" Value="#FFE0E0E0"/>
                                                                </Trigger>
                                                                <Trigger Property="IsWatermarkVisible" Value="True">
                                                                    <Setter Property="Visibility" TargetName="Watermark" Value="Visible"/>
                                                                </Trigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsEnabled" Value="True"/>
                                                                        <Condition Property="IsMouseOver" Value="True"/>
                                                                    </MultiTrigger.Conditions>
                                                                    <MultiTrigger.EnterActions>
                                                                        <BeginStoryboard>
                                                                            <Storyboard>
                                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                                                    <LinearDoubleKeyFrame KeyTime="0:0:0.115" Value="1"/>
                                                                                </DoubleAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Visible</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </BeginStoryboard>
                                                                    </MultiTrigger.EnterActions>
                                                                    <MultiTrigger.ExitActions>
                                                                        <BeginStoryboard>
                                                                            <Storyboard>
                                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="MouseOverVisual">
                                                                                    <LinearDoubleKeyFrame KeyTime="0:0:0.15" Value="0"/>
                                                                                </DoubleAnimationUsingKeyFrames>
                                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="MouseOverVisual">
                                                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0.15">
                                                                                        <DiscreteObjectKeyFrame.Value>
                                                                                            <Visibility>Collapsed</Visibility>
                                                                                        </DiscreteObjectKeyFrame.Value>
                                                                                    </DiscreteObjectKeyFrame>
                                                                                </ObjectAnimationUsingKeyFrames>
                                                                            </Storyboard>
                                                                        </BeginStoryboard>
                                                                    </MultiTrigger.ExitActions>
                                                                    <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                                                                    <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                                                                </MultiTrigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsEnabled" Value="True"/>
                                                                        <Condition Property="IsDropDownOpen" Value="True"/>
                                                                    </MultiTrigger.Conditions>
                                                                    <Setter Property="BorderBrush" TargetName="Border">
                                                                        <Setter.Value>
                                                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                                                <GradientStop Color="#FF282828"/>
                                                                                <GradientStop Color="#FF5F5F5F" Offset="1"/>
                                                                            </LinearGradientBrush>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="Foreground" TargetName="DropDownIcon" Value="Black"/>
                                                                    <Setter Property="Background" TargetName="DropDownIcon" Value="White"/>
                                                                </MultiTrigger>
                                                                <MultiTrigger>
                                                                    <MultiTrigger.Conditions>
                                                                        <Condition Property="IsKeyboardFocusWithin" Value="True"/>
                                                                        <Condition Property="IsDropDownOpen" Value="False"/>
                                                                    </MultiTrigger.Conditions>
                                                                    <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible"/>
                                                                </MultiTrigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </telerik:RadComboBox.Template>
                                                </telerik:RadComboBox>
                                            </StackPanel>
                                        </Grid>
                                    </Grid>
                                </Border>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <Border BorderThickness="3,0,3,3" CornerRadius="10"  Background="Black">
            <Border.BorderBrush>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFADAAAA" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                    <GradientStop Color="#FFA7A4A4" Offset="0.822"/>
                    <GradientStop Color="#FFFDFDFD" Offset="0.658"/>
                    <GradientStop Color="#FFF6F5F5" Offset="0.338"/>
                    <GradientStop Color="#FEACA9A9" Offset="0.513"/>
                    <GradientStop Color="#FEFAFAFA" Offset="0.164"/>
                </LinearGradientBrush>
            </Border.BorderBrush>
            <Grid Margin="0,0,-3,-3"/>
        </Border>
        <my:ReportViewer  x:Name="ReportViewer1"  Margin="8,40,8,8" Style="{DynamicResource ReportViewerStyle2}" />
        <Grid x:Name="grdTitleBar" Height="30.4" Margin="0.6,0,0,0" VerticalAlignment="Top">
            <Button x:Name="btnClose" HorizontalAlignment="Right" Margin="0,3,5.001,5.4" Style="{DynamicResource TitleBarButton}" Width="22" Click="btnClose_Click" ToolTip="Exit Window"/>
        </Grid>
    </Grid>
</Window>
