<Window x:Class="CommonTasksMVVM.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:CommonTasksMVVM"
        mc:Ignorable="d"
        WindowState="Maximized"
        Title="MainWindow"
        Height="350" Width="525"
        DataContext="{Binding MainViewModel, Source={StaticResource Locator}}"
        Loaded="Window_Loaded"
        >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <ScrollViewer Grid.RowSpan="2">
            <ItemsControl ItemsSource="{Binding CategoryList}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <c1:C1Expander Header="{Binding CategoryName}" IsExpanded="True" Margin="3" BorderThickness="1">
                            <ItemsControl ItemsSource="{Binding Reports}" Margin="10, 0, 0, 0">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <TextBlock Margin="0, 2, 0, 2">
                                            <Hyperlink
                                                Command="{Binding DataContext.ClickReportCommand, RelativeSource={RelativeSource AncestorType=Window}}"
                                                CommandParameter="{Binding}"
                                                >
                                                <TextBlock Text="{Binding}"/>                                               
                                            </Hyperlink>
                                        </TextBlock>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </c1:C1Expander>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>

        <local:FVToolBar x:Name="fvToolBar"  Grid.Column="1" />

        <c1:C1FlexViewerPane
            x:Name="fvp" 
            Grid.Column="1"
            Grid.Row="1"
            DocumentSource="{Binding FlexReport}"
            >
            <c1:C1FlexViewerPane.ContextMenu>
                <ContextMenu x:Name="fvpContextMenu">
                    <MenuItem x:Name="copyMenuItem" Header="Copy"/>
                    <Separator />
                    <MenuItem x:Name="selectAllMenuItem" Header="Select All"/>
                    <MenuItem x:Name="deselectMenuItem" Header="Deselect"/>
                </ContextMenu>
            </c1:C1FlexViewerPane.ContextMenu>
        </c1:C1FlexViewerPane>
    </Grid>
</Window>
