<localView:BeWoView x:Class="BeWo.View.Detail.WordDocumentTemplateView"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:localView="clr-namespace:BeWo.View"
                    xmlns:uc="clr-namespace:BeWo.Controls;assembly=BeWo.Controls"
                    xmlns:localViewModel="clr-namespace:BeWo.ViewModel"
                    xmlns:dxg="clr-namespace:DevExpress.Xpf.Grid;assembly=DevExpress.Xpf.Grid.v13.1"
                    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase" 
                    Height="Auto" Width="Auto" HorizontalAlignment="Stretch" 
                    VerticalAlignment="Stretch" Focusable="True">
    <localView:BeWoView.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded" />
    </localView:BeWoView.Triggers>
    <localView:BeWoView.Resources>
        <ContextMenu x:Key="Cm" MenuItem.Click="ContextMenu_Click" Opened="ContextMenu_Opened">
            <MenuItem Header="Neu">
                <MenuItem.Icon>
                    <Image Source="..\..\Ressources\Icons\Add24.png" />
                </MenuItem.Icon>
            </MenuItem>
            <MenuItem Header="Umbenennen">
                <MenuItem.Icon>
                    <Image Source="..\..\Ressources\Icons\Rename24.png" />
                </MenuItem.Icon>
            </MenuItem>
            <Separator />
            <MenuItem Header="Löschen">
                <MenuItem.Icon>
                    <Image Source="..\..\Ressources\Icons\Delete24.png" />
                </MenuItem.Icon>
            </MenuItem>
        </ContextMenu>
        <HierarchicalDataTemplate x:Key="Test" DataType="{x:Type localViewModel:BeWoFolderVM}" ItemsSource="{Binding SubFolders}">
            <StackPanel Orientation="Horizontal" ContextMenu="{StaticResource Cm}">
                <Image Name="img" Width="20" Height="20" Stretch="Fill" Source="..\..\Ressources\Icons\Folder.png" />
                <TextBox Cursor="Arrow" Background="Transparent" Padding="2 1" LostFocus="TextBox_LostFocus" KeyDown="TextBox_KeyDown" BorderThickness="0" IsReadOnly="True" Text="{Binding Path=Name}" />
            </StackPanel>
        </HierarchicalDataTemplate>
    </localView:BeWoView.Resources>
    <Grid>
        <uc:ShadowChrome>
            <GroupBox Style="{DynamicResource MainContentGroupBoxStyle}">
                <GroupBox.Header>
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
                        <Image Source="..\..\Ressources\Icons\MenuDisabled.png" RenderTransformOrigin="0.5,0.5" Stretch="Uniform" Width="32">
                            <Image.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                    <SkewTransform AngleX="0" AngleY="0" />
                                    <RotateTransform Angle="0" />
                                    <TranslateTransform X="0" Y="5" />
                                </TransformGroup>
                            </Image.RenderTransform>
                        </Image>
                        <TextBox Text="Vorlagen verwalten" Margin="10,10,0,0" Background="{x:Null}" Foreground="#FFFFFFFF" FontSize="22" BorderBrush="{x:Null}" VerticalAlignment="Bottom" Padding="0,0,0,0" />
                    </StackPanel>
                </GroupBox.Header>
                <Grid Margin="0,3,0,0" Background="{DynamicResource ObjectEditBackgroundBrush}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <GroupBox Grid.ColumnSpan="2" Padding="5" Style="{StaticResource ObjectEditGroupBox}" Header="Neue Vorlage hochladen">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <Label Grid.Row="1" Content="Datei" />
                            <uc:PopUpEdit IsReadOnly="True" Name="PopupeditFile" Grid.Column="1" Margin="3" Height="23" Grid.Row="1" DeleteButtonVisibility="Collapsed" PopUpClick="popupedit_file_PopUpClick" />
                            <Label Grid.Row="1" Grid.Column="4" Content="Beschreibung" />
                            <Label Grid.Row="1" Grid.Column="2" Content="Typ" Margin="3" />
                            <ComboBox x:Name="FileAttachmentTypeComboBox" Grid.Row="1" Grid.Column="3" Width="150" Height="23" Margin="3" SelectedIndex="0" DisplayMemberPath="Value" ItemsSource="{Binding Path=FileAttachmentTypeDictionary, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type localView:BeWoView}}}"></ComboBox>
                            <TextBox Name="TextboxFileNotice" Margin="3" Height="23" Grid.Row="1" Grid.Column="5" />
                            <Button IsEnabled="False" Name="ButtonUploadDocument" Margin="3" Height="25" Grid.Row="1" Grid.Column="6" Click="button_uploadDocument_Click" Content="Dokument hochladen" />
                            <ProgressBar Height="20" Margin="3" Name="ProgressbarUpload" Grid.Row="2" Grid.ColumnSpan="7" Minimum="0" Maximum="1" />
                            <Label VerticalAlignment="Center" Grid.Row="2" Grid.ColumnSpan="5" HorizontalAlignment="Center" Name="TextProgress" />
                        </Grid>
                    </GroupBox>
                    <TreeView Grid.Row="1" Margin="5,3,2,5" PreviewMouseDown="TreeViewItem_PreviewMouseRightButtonDown" x:Name="Treeview" MinWidth="200" ItemTemplate="{StaticResource Test}" ItemsSource="{Binding}"></TreeView>

                    <dxg:GridControl Grid.Row="1" Margin="2,3,5,5" DataSource="{Binding SelectedItem.Files, ElementName=Treeview, diagnostics:PresentationTraceSources.TraceLevel=High}" x:Name="datagrid_documents" Grid.Column="1">
                        <dxg:GridControl.Columns>
                            <dxg:GridColumn FieldName="FileName" Header="" FixedWidth="True" Width="24" ReadOnly="True">
                                <dxg:GridColumn.CellTemplate>
                                    <DataTemplate>
                                        <Button Content="r" FontFamily="Webdings" Click="DeleteButton_Click" Width="18" Height="18" VerticalAlignment="Center" />
                                    </DataTemplate>
                                </dxg:GridColumn.CellTemplate>
                            </dxg:GridColumn>
                            <dxg:GridColumn FieldName="InsertedOn" AllowEditing="False" Header="hinterlegt am" Width="100" />
                            <dxg:GridColumn FieldName="InsertedBy" AllowEditing="False" Header="hinterlegt von" Width="150" />
                            <dxg:GridColumn FieldName="FileName" AllowEditing="False" Header="Dateiname" Width="180" />
                            <dxg:GridColumn FieldName="Description" AllowEditing="False" Header="Beschreibung" Width="180" />
                            <dxg:GridColumn DisplayMemberBinding="{Binding Path=RowData.Row.FileAttachmentType, Converter={StaticResource FileAttachmentTypeConverter}}" AllowEditing="False" Header="Typ"></dxg:GridColumn>
                            <dxg:GridColumn FieldName="URL" Header="" Width="180">
                                <dxg:GridColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock>
									            <Hyperlink TargetName="inexistent" NavigateUri="{Binding Path=Value, Converter={StaticResource DownloadURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">
										            <TextBlock Text="herunterladen" />
									            </Hyperlink>
								            </TextBlock>
                                            <TextBlock Text=" " />
                                            <TextBlock>
									            <Hyperlink TargetName="inexistent" Tag="Bearbeiten" NavigateUri="{Binding Path=Value, Converter={StaticResource DownloadURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">
										            <TextBlock Text="bearbeiten" />
									            </Hyperlink>
								            </TextBlock>
                                            <!--<TextBlock Text=" "/>
                                            <TextBlock>
									            <Hyperlink TargetName="inexistent" Tag="Vorschau" NavigateUri="{Binding Path=Value, Converter={StaticResource DownloadURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">
										            <TextBlock Text="vorschau" />
									            </Hyperlink>
								            </TextBlock>
                                            <TextBlock Text=" "/>
                                            <TextBlock>
									            <Hyperlink TargetName="inexistent" Tag="Drucken" NavigateUri="{Binding Path=Value, Converter={StaticResource DownloadURLConverter}}" RequestNavigate="Hyperlink_OnRequestNavigate">
										            <TextBlock Text="drucken" />
									            </Hyperlink>
								            </TextBlock>-->
                                        </StackPanel>
                                    </DataTemplate>
                                </dxg:GridColumn.CellTemplate>
                            </dxg:GridColumn>
                        </dxg:GridControl.Columns>
                        <dxg:GridControl.View>
                            <dxg:TableView AutoWidth="true" ShowGroupPanel="False" ShowGroupedColumns="false" ShowTotalSummary="False" NavigationStyle="Cell" />
                        </dxg:GridControl.View>
                    </dxg:GridControl>
                </Grid>
            </GroupBox>
        </uc:ShadowChrome>
        <Canvas>
            <Grid x:Name="CursorControl" Visibility="Visible">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Border Background="AliceBlue" Opacity="0.75">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Image x:Name="ImageFolder" Source="..\..\Ressources\Icons\Folder.png" />
                        <Image x:Name="ImageFile" Source="..\..\Ressources\Icons\Document48.png" />
                        <TextBlock x:Name="LabelFrom" Grid.Column="1" Text="Datei xyz.txt" Margin="3" />
                    </Grid>
                </Border>
                <TextBlock x:Name="LabelTo" Grid.Row="1" Grid.ColumnSpan="2" Text="-&gt; Nach verschieben" Margin="3" Foreground="Blue" Opacity="1" />
            </Grid>
        </Canvas>
    </Grid>
</localView:BeWoView>
