<UserControl x:Class="StructureHelper.Windows.UserControls.ListOfFileControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:StructureHelper.Windows.UserControls"
             xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
             xmlns:forces="clr-namespace:StructureHelper.Windows.Forces"
             d:DataContext="{d:DesignInstance forces:ListOfFilesVM}"
             mc:Ignorable="d" 
             d:DesignHeight="250" d:DesignWidth="400">
    <DockPanel>
        <ToolBarTray DockPanel.Dock="Top">
            <ToolBar>
                <Button Style="{StaticResource ToolButton24}" 
                        Command="{Binding FileOpen}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Open file"
                                                IconContent="{StaticResource FileOpen}"
                                                DescriptionText="Open exsisting project from file"/>
                    </Button.ToolTip>
                    <Viewbox Height="24" Width="24">
                        <ContentControl ContentTemplate="{DynamicResource FileOpen}"/>
                    </Viewbox>
                </Button>
                <Button Style="{StaticResource ToolButton24}" Command="{Binding Delete}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Delete reference to file"
                                                IconContent="{StaticResource DeleteEntity }"
                                                DescriptionText="Deletes selected reference to file"/>
                    </Button.ToolTip>
                    <Viewbox Height="24" Width="24">
                        <ContentControl ContentTemplate="{DynamicResource DeleteEntity}"/>
                    </Viewbox>
                </Button>
                <Button Style="{StaticResource ToolButton24}" 
                        Command="{Binding ShowSettings}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="Settings"
                                                IconContent="{StaticResource Settings}"
                                                DescriptionText="Shows settings of import of file"/>
                    </Button.ToolTip>
                    <Viewbox Height="24" Width="24">
                        <ContentControl ContentTemplate="{DynamicResource Settings}"/>
                    </Viewbox>
                </Button>
                <Button Style="{StaticResource ToolButton24}" Visibility="Hidden" 
                        Command="{Binding ShowDocument}">
                    <Button.ToolTip>
                        <uc:ButtonToolTipEh HeaderText="View file"
                                                IconContent="{StaticResource Report}"
                                                DescriptionText="Shows file data if it is possible"/>
                    </Button.ToolTip>
                    <Viewbox Height="24" Width="24">
                        <ContentControl ContentTemplate="{DynamicResource Report}"/>
                    </Viewbox>
                </Button>
            </ToolBar>
        </ToolBarTray>
        <Grid>
            <ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
                <ListBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Delete" Command="{Binding Delete}"/>
                    </ContextMenu>
                </ListBox.ContextMenu>
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding FilePath}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </DockPanel>
</UserControl>
