<commit_before>﻿<UserControl 
    x:Class="PackageExplorer.PackageViewer" 
    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:self="clr-namespace:PackageExplorer" 
    xmlns:viewmodel="clr-namespace:PackageExplorerViewModel;assembly=PackageViewModel" 
    xmlns:core="clr-namespace:NuGet.Packaging.Core;assembly=NuGet.Packaging"
    xmlns:packaging="clr-namespace:NuGet.Packaging;assembly=NuGet.Packaging"
    xmlns:nugetpe="clr-namespace:NuGetPe;assembly=Core"
    xmlns:spinners="clr-namespace:xamlSpinnersWPF"
    Visibility="{Binding Converter={StaticResource NullToVisibilityConverter}, FallbackValue=Collapsed}" 
    Margin="5,7,5,7"
    mc:Ignorable="d" 
    d:DesignHeight="300" 
    d:DesignWidth="300">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Xaml/TemplateStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <self:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
            <self:CountToVisibilityConverter Inverted="True" x:Key="invertedCountConverter" />
            <self:StringCollectionsToStringConverter x:Key="authorNamesConverter" />
            <self:UppercaseConverter x:Key="upperCaseConverter" />
            <self:FrameworkNameConverter x:Key="frameworkConverter" />
            <self:NormalizeTextConverter x:Key="NormalizeTextConverter" />
            <self:BooleanToStringConverter x:Key="BooleanConverter" />
            <self:BooleanToVisibilityConverter x:Key="BooleanToVisConverter" />
            <self:DependencySetConverter x:Key="DependencySetConverter" />
            <self:ReferenceSetConverter x:Key="ReferenceSetConverter" />
            <self:PackageDependencyConverter x:Key="PackageDependencyConverter" />
            <self:FrameworkAssemblyReferenceDisplayConverter x:Key="FrameworkAssemblyReferenceDisplayConverter" />
            <self:NuGetVersionConverter x:Key="NuGetVersionConverter" />
            <self:NuGetVersionPreReleaseConverter x:Key="NuGetVersionPreReleaseConverter" />
            <self:ListToStringConverter x:Key="ListToStringConverter" />

            <DataTemplate DataType="{x:Type core:PackageDependency}">
                <TextBlock ToolTip="Open this package from online feed.">
                    <Hyperlink Command="Print" CommandParameter="{Binding Id, Mode=OneWay}">
                        <Run Text="{Binding Mode=OneWay, Converter={StaticResource PackageDependencyConverter}}"></Run>
                    </Hyperlink>
                </TextBlock>
            </DataTemplate>

            <DataTemplate DataType="{x:Type viewmodel:EditablePackageMetadata}" x:Key="VerifySignaturesResult">

                <StackPanel Orientation="Horizontal" Cursor="Hand" ToolTip="{x:Static self:Resources.Dialog_ShowDetails}" >
                    <StackPanel.InputBindings>
                        <MouseBinding Gesture="LeftClick" Command="{Binding ShowValidationResultsCommand}" />
                    </StackPanel.InputBindings>
                    <TextBlock Name="isValid" Text="{x:Static self:Resources.Validation_Pending}" />
                    <ContentControl Name="icon" Margin="3,0,0,0" Width="16" Height="16" Visibility="Collapsed"  />
                    <spinners:ucSpinnerDotCircle x:Name="spinner" Margin="3,0,0,0" Width="16" Height="16" Foreground="Black" />
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Valid">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Valid}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityOkIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Disallowed">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Disallowed}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityCriticalIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Suspect">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Suspect}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityWarningIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Unknown">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Unknown}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityWarningIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate DataType="{x:Type nugetpe:SignatureInfo}">
                <StackPanel>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}" >
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding SignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding SignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding Timestamp, Converter={StaticResource NullToVisibilityConverter}}"
                               >
                        <Run Text="@"/>
                        <Run Text="{Binding Timestamp, Converter={StaticResource DateTimeOffsetLongDateConverter}, ConverterParameter=F, Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding TimestampSignerInfo, Converter={StaticResource NullToVisibilityConverter}}"
                               >
                        <Run Text="by"/>
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding TimestampSignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding TimestampSignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                </StackPanel>
            </DataTemplate>


            <DataTemplate DataType="{x:Type nugetpe:RepositorySignatureInfo}">
                <StackPanel>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}" >
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding SignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding SignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding Timestamp, Converter={StaticResource NullToVisibilityConverter}}"
                    >
                        <Run Text="@"/>
                        <Run Text="{Binding Timestamp, Converter={StaticResource DateTimeOffsetLongDateConverter}, ConverterParameter=F, Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding TimestampSignerInfo, Converter={StaticResource NullToVisibilityConverter}}"
                    >
                        <Run Text="by"/>
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding TimestampSignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding TimestampSignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}">
                        <Run Text="Owners: " /><Run Text="{Binding PackageOwners, Converter={StaticResource ListToStringConverter}, ConverterParameter=', ', Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}">
                        <Run Text="Service Index: " /><Hyperlink Command="GoToPage" CommandParameter="{Binding V3ServiceIndexUrl, Mode=OneWay}">
                            <Run Text="{Binding V3ServiceIndexUrl, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type core:RepositoryMetadata}">
                <StackPanel>
                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Type, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryType}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Type}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Url, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryUrl}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Style="{StaticResource DetailMetadataValueStyle}">
                            <Hyperlink Command="GoToPage" CommandParameter="{Binding Url, Mode=OneWay}">
                                <Run Text="{Binding Url}" />
                            </Hyperlink>
                        </TextBlock>
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Branch, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryBranch}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Branch}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>


                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Commit, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryCommit}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Commit}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type packaging:LicenseMetadata}">
                <StackPanel>
                    <StackPanel Style="{StaticResource DetailMetadataStyle}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryType}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Type}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding License, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.PackageChooser_DetailLicense}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding License}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <TextBlock Visibility="{Binding LicenseUrl, Converter={StaticResource NullToVisibilityConverter}}">
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding LicenseUrl}" ToolTip="{Binding LicenseUrl}">
                            <Run Text="{x:Static self:Resources.Dialog_ViewLicense}" />
                        </Hyperlink>
                    </TextBlock>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding LicenseExpression, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_LicenseExpressionVersion}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Version}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding LicenseExpression, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_LicenseExpression}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding LicenseExpression}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type packaging:PackageDependencyGroup}">
                <Grid Margin="0,0,0,8">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock Text="{Binding TargetFramework, TargetNullValue={x:Static self:Resources.NoFxDependencyGroup}}" FontWeight="SemiBold" TextWrapping="Wrap" />
                    <ItemsControl
                        x:Name="dependenciesList"
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        ItemsSource="{Binding Packages}" />

                    <TextBlock
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        Visibility="{Binding Items.Count, ElementName=dependenciesList, Converter={StaticResource invertedCountConverter}}"
                        Style="{StaticResource NoDependencyTextBoxStyle}" 
                        Text="{x:Static self:Resources.Dialog_NoDependencyLabel}">
                    </TextBlock>
                </Grid>
            </DataTemplate>

            <DataTemplate x:Key="PackageReferenceItemTemplate">
                <TextBlock Text="{Binding Mode=OneWay}" TextTrimming="CharacterEllipsis" />
            </DataTemplate>

            <DataTemplate DataType="{x:Type packaging:PackageReferenceSet}">
                <Grid Margin="0,0,0,8">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock Text="{Binding TargetFramework, TargetNullValue={x:Static self:Resources.NoFxDependencyGroup}}" FontWeight="SemiBold" TextWrapping="Wrap" />
                    <ItemsControl
                        x:Name="referencesList"
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        ItemsSource="{Binding References}"
                        ItemTemplate="{StaticResource PackageReferenceItemTemplate}" />
                </Grid>
            </DataTemplate>

            <ContextMenu x:Key="SharedContextMenu" DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                <MenuItem Header="_View Content" InputGestureText="Enter" Command="{Binding ViewCommand}" CommandParameter="{Binding}" FontWeight="SemiBold" />
                <MenuItem Header="_Open in Windows shell..." Command="{Binding OpenCommand}" CommandParameter="{Binding}" />
                <MenuItem Header="Open _with..." Command="{Binding OpenWithCommand}" CommandParameter="{Binding}" />
                <MenuItem Header="_Save As..." Command="{Binding SaveCommand}" CommandParameter="{Binding}" Icon="{StaticResource SaveAsIcon}" />
                <MenuItem Header="Copy" Command="Copy" Icon="{StaticResource CopyIcon}" />
                <Separator />
                <MenuItem Header="_Edit" Command="{Binding EditCommand}" CommandParameter="{Binding}" />
                <Separator />
                <MenuItem Header="_Rename..." InputGestureText="F2" Command="{Binding RenameCommand}" CommandParameter="{Binding}" />
                <MenuItem Header="Re_place with..." Command="{Binding ReplaceCommand}" CommandParameter="{Binding}" />
                <self:GrayscaleMenuItem Header="_Delete" InputGestureText="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding}">
                    <self:GrayscaleMenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource RemoveIcon}" />
                    </self:GrayscaleMenuItem.Icon>
                </self:GrayscaleMenuItem>
            </ContextMenu>

            <ContextMenu x:Key="FolderSharedContextMenu" Opened="PackageFolderContextMenu_Opened" DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">

                <self:GrayscaleMenuItem Header="Add .props file" Command="{Binding AddBuildFileCommand, Mode=OneWay}" CommandParameter=".props" Visibility="{Binding Path, Converter={StaticResource StringToVisibilityConverter}, ConverterParameter=build;build\\*}">
                    <MenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource PropertyIcon}" />
                    </MenuItem.Icon>
                </self:GrayscaleMenuItem>

                <self:GrayscaleMenuItem Header="Add .targets file" Command="{Binding AddBuildFileCommand, Mode=OneWay}" CommandParameter=".targets" Visibility="{Binding Path, Converter={StaticResource StringToVisibilityConverter}, ConverterParameter=build;build\\*}">
                    <MenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource PropertyIcon}" />
                    </MenuItem.Icon>
                </self:GrayscaleMenuItem>

                <Separator Visibility="{Binding Path, Converter={StaticResource StringToVisibilityConverter}, ConverterParameter=build;build\\*}" />

                <MenuItem Header="Add _New File..." Command="{Binding AddNewFileCommand}" CommandParameter="{Binding}" Icon="{StaticResource NewItemIcon}" />
                <MenuItem Header="_Add Existing File..." Command="{Binding AddContentFileCommand}" CommandParameter="{Binding}" Icon="{StaticResource AddItemIcon}" />
                <MenuItem Header="Add Ne_w Folder" Command="{Binding AddNewFolderCommand}" CommandParameter="{Binding}" Icon="{StaticResource AddFolderIcon}" />
                <MenuItem Header="Paste" Command="Paste" Icon="{StaticResource PasteIcon}" />
                <MenuItem Header="_Rename..." InputGestureText="F2" Command="{Binding RenameCommand}" CommandParameter="{Binding}" Icon="{StaticResource RenameIcon}" />
                <self:GrayscaleMenuItem Header="_Delete" InputGestureText="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding}">
                    <self:GrayscaleMenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource RemoveIcon}" />
                    </self:GrayscaleMenuItem.Icon>
                </self:GrayscaleMenuItem>
            </ContextMenu>

            <DataTemplate x:Key="SimpleTextItemTemplate">
                <TextBlock Text="{Binding}" TextTrimming="CharacterEllipsis" ToolTipService.ToolTip="{Binding}" />
            </DataTemplate>

            <!-- data template for the package details pane -->
            <DataTemplate x:Key="PackageDetailTemplate">
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                    <StackPanel Margin="8">
                        <Border BorderBrush="{StaticResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="0.5" HorizontalAlignment="Left" Padding="2" Background="White" Margin="0,0,0,5" ToolTipService.ToolTip="{Binding IconUrl}" Visibility="{Binding IconUrl, Converter={StaticResource NullToVisibilityConverter}}">
                            <Image Source="{Binding IconUrl, TargetNullValue={x:Null}}" Width="32" Height="32" Stretch="Fill" StretchDirection="DownOnly" />
                        </Border>

                        <!-- Id -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_IdLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Id}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Version -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_VersionLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Version, Converter={StaticResource NuGetVersionConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                            <TextBlock Margin="3,0,0,0" Text="(prerelease)" Foreground="DarkRed" Visibility="{Binding Version, Mode=OneWay, Converter={StaticResource NuGetVersionPreReleaseConverter}}" />
                        </StackPanel>

                        <!-- Publisher -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" 
                                    Visibility="{Binding PublisherSignature, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_PublisherLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Content="{Binding PublisherSignature, Mode=OneWay}" />
                            
                        </StackPanel>

                        <!-- Repository -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" 
                                    Visibility="{Binding RepositorySignature, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Content="{Binding RepositorySignature, Mode=OneWay}" />

                        </StackPanel>
  
                        <!-- Validation -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" 
                                    Visibility="{Binding IsSigned, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_SignatureValidation}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Content="{Binding Mode=OneWay}" ContentTemplate="{StaticResource VerifySignaturesResult}" Margin="3,0,0,0" />
                        </StackPanel>

                        <!-- Title -->
                        <DockPanel Margin="0,3,0,0" Visibility="{Binding Title, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_TitleLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Title}" Style="{StaticResource DetailMetadataValueStyle}" TextTrimming="CharacterEllipsis" />
                        </DockPanel>

                        <!-- Authors -->
                        <DockPanel Margin="0,3,0,0">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_CreatedByLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Authors, Converter={StaticResource authorNamesConverter}}" Style="{StaticResource DetailMetadataValueStyle}" TextWrapping="Wrap" />
                        </DockPanel>

                        <!-- Owners -->
                        <DockPanel Margin="0,3,0,0" Visibility="{Binding Owners, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_OwnersLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Owners, Converter={StaticResource authorNamesConverter}}" Style="{StaticResource DetailMetadataValueStyle}" TextWrapping="Wrap" />
                        </DockPanel>

                        <!-- Min client version -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding MinClientVersion, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_MinVersionLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding MinClientVersion}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Development Dependency -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding DevelopmentDependency, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_DevelopmentDependencyLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding DevelopmentDependency, Converter={StaticResource BooleanConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Tags -->
                        <DockPanel Margin="0,3,0,0" Visibility="{Binding Tags, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_TagLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Tags}" Style="{StaticResource DetailMetadataValueStyle}" TextWrapping="Wrap" />
                        </DockPanel>

                        <!-- Language -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Language, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_LanguageLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Language}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Require License Acceptance -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding RequireLicenseAcceptance, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_RequireLicenseLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding RequireLicenseAcceptance, Converter={StaticResource BooleanConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- View License link -->
                        <TextBlock Visibility="{Binding LicenseUrl, Converter={StaticResource NullToVisibilityConverter}}">
                            <Hyperlink Command="GoToPage" CommandParameter="{Binding LicenseUrl}" ToolTip="{Binding LicenseUrl}">
                                <Run Text="{x:Static self:Resources.Dialog_ViewLicense}" />
                            </Hyperlink>
                        </TextBlock>

                        <!-- License Metadata -->
                        <StackPanel
                            Visibility="{Binding LicenseMetadata, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_LicenceMeta}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Margin="14,0,0,0" Content="{Binding LicenseMetadata, Mode=OneWay}" />
                        </StackPanel>

                        <!-- Project Url -->
                        <TextBlock Visibility="{Binding ProjectUrl, Converter={StaticResource NullToVisibilityConverter}}">
                            <Hyperlink Command="GoToPage" CommandParameter="{Binding ProjectUrl}" ToolTip="{Binding ProjectUrl}">
                                <Run Text="{x:Static self:Resources.Dialog_MoreInfo}" />
                            </Hyperlink>
                        </TextBlock>

                        <!-- Copyright -->
                        <TextBlock Text="Copyright:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}" Visibility="{Binding Copyright, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding Copyright, Converter={StaticResource NormalizeTextConverter}}" Visibility="{Binding Copyright, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <!-- Serviceable -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Serviceable, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_ServiceableLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Serviceable, Converter={StaticResource BooleanConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Repository -->
                        <StackPanel
                            Visibility="{Binding Repository, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Margin="14,0,0,0" Content="{Binding Repository, Mode=OneWay}" />

                        </StackPanel>

                        <!-- Summary -->
                        <TextBlock Text="Summary:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}" Visibility="{Binding Summary, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding Summary, Converter={StaticResource NormalizeTextConverter}}" Visibility="{Binding Summary, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <!-- Description -->
                        <TextBlock Text="Description:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding Description, Converter={StaticResource NormalizeTextConverter}}"></TextBlock>

                        <!-- Release Notes -->
                        <TextBlock Text="Release notes:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}" Visibility="{Binding ReleaseNotes, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding ReleaseNotes, Converter={StaticResource NormalizeTextConverter}}" Visibility="{Binding ReleaseNotes, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <!-- Dependencies list -->
                        <TextBlock Text="{x:Static self:Resources.Dialog_DependenciesLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="DependencyItems" Margin="25,5,0,0" ItemsSource="{Binding DependencySets, Converter={StaticResource DependencySetConverter}}">
                        </ItemsControl>

                        <TextBlock Margin="25,5,0,0" Visibility="{Binding Items.Count, ElementName=DependencyItems, Converter={StaticResource invertedCountConverter}}" Style="{StaticResource NoDependencyTextBoxStyle}" Text="{x:Static self:Resources.Dialog_NoDependencyLabel}"></TextBlock>

                        <!-- Framework assembly references -->
                        <TextBlock Visibility="{Binding Items.Count, ElementName=FrameworkAssemblyItems, Converter={StaticResource countConverter}}" Text="{x:Static self:Resources.Dialog_FrameworkAssembliesLabel}" Margin="0,5,0,0" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="FrameworkAssemblyItems" Margin="25,5,0,0" ItemsSource="{Binding FrameworkAssemblies}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate DataType="{x:Type packaging:FrameworkAssemblyReference}">
                                    <Grid Margin="0,4,0,0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Grid.Column="0" Margin="4,0,4,0" Text="{Binding Converter={StaticResource FrameworkAssemblyReferenceDisplayConverter}, ConverterParameter=includeAssembly}" TextTrimming="CharacterEllipsis" />
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        
                        <!-- Package Assembly References -->
                        <TextBlock Visibility="{Binding Items.Count, ElementName=PackageAssemblyReferences, Converter={StaticResource countConverter}}" Text="Filtered Assembly References:" Margin="0,5,0,0" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="PackageAssemblyReferences" Margin="25,5,0,0" ItemsSource="{Binding PackageAssemblyReferences, Converter={StaticResource ReferenceSetConverter}}">
                        </ItemsControl>
                    </StackPanel><commit_msg>Display Framework References<commit_after>﻿<UserControl 
    x:Class="PackageExplorer.PackageViewer" 
    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:self="clr-namespace:PackageExplorer" 
    xmlns:viewmodel="clr-namespace:PackageExplorerViewModel;assembly=PackageViewModel" 
    xmlns:core="clr-namespace:NuGet.Packaging.Core;assembly=NuGet.Packaging"
    xmlns:packaging="clr-namespace:NuGet.Packaging;assembly=NuGet.Packaging"
    xmlns:nugetpe="clr-namespace:NuGetPe;assembly=Core"
    xmlns:spinners="clr-namespace:xamlSpinnersWPF"
    Visibility="{Binding Converter={StaticResource NullToVisibilityConverter}, FallbackValue=Collapsed}" 
    Margin="5,7,5,7"
    mc:Ignorable="d" 
    d:DesignHeight="300" 
    d:DesignWidth="300">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Xaml/TemplateStyles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <self:StringToVisibilityConverter x:Key="StringToVisibilityConverter" />
            <self:CountToVisibilityConverter Inverted="True" x:Key="invertedCountConverter" />
            <self:StringCollectionsToStringConverter x:Key="authorNamesConverter" />
            <self:UppercaseConverter x:Key="upperCaseConverter" />
            <self:FrameworkNameConverter x:Key="frameworkConverter" />
            <self:NormalizeTextConverter x:Key="NormalizeTextConverter" />
            <self:BooleanToStringConverter x:Key="BooleanConverter" />
            <self:BooleanToVisibilityConverter x:Key="BooleanToVisConverter" />
            <self:DependencySetConverter x:Key="DependencySetConverter" />
            <self:ReferenceSetConverter x:Key="ReferenceSetConverter" />
            <self:PackageDependencyConverter x:Key="PackageDependencyConverter" />
            <self:FrameworkAssemblyReferenceDisplayConverter x:Key="FrameworkAssemblyReferenceDisplayConverter" />
            <self:NuGetVersionConverter x:Key="NuGetVersionConverter" />
            <self:NuGetVersionPreReleaseConverter x:Key="NuGetVersionPreReleaseConverter" />
            <self:ListToStringConverter x:Key="ListToStringConverter" />

            <DataTemplate DataType="{x:Type core:PackageDependency}">
                <TextBlock ToolTip="Open this package from online feed.">
                    <Hyperlink Command="Print" CommandParameter="{Binding Id, Mode=OneWay}">
                        <Run Text="{Binding Mode=OneWay, Converter={StaticResource PackageDependencyConverter}}"></Run>
                    </Hyperlink>
                </TextBlock>
            </DataTemplate>

            <DataTemplate DataType="{x:Type viewmodel:EditablePackageMetadata}" x:Key="VerifySignaturesResult">

                <StackPanel Orientation="Horizontal" Cursor="Hand" ToolTip="{x:Static self:Resources.Dialog_ShowDetails}" >
                    <StackPanel.InputBindings>
                        <MouseBinding Gesture="LeftClick" Command="{Binding ShowValidationResultsCommand}" />
                    </StackPanel.InputBindings>
                    <TextBlock Name="isValid" Text="{x:Static self:Resources.Validation_Pending}" />
                    <ContentControl Name="icon" Margin="3,0,0,0" Width="16" Height="16" Visibility="Collapsed"  />
                    <spinners:ucSpinnerDotCircle x:Name="spinner" Margin="3,0,0,0" Width="16" Height="16" Foreground="Black" />
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Valid">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Valid}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityOkIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Disallowed">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Disallowed}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityCriticalIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Suspect">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Suspect}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityWarningIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ValidationResult.Trust}" Value="Unknown">
                        <Setter TargetName="isValid" Property="Text" Value="{x:Static self:Resources.Validation_Unknown}" />
                        <Setter TargetName="icon" Property="Content" Value="{StaticResource StatusSecurityWarningIcon}" />
                        <Setter TargetName="icon" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="spinner" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate DataType="{x:Type nugetpe:SignatureInfo}">
                <StackPanel>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}" >
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding SignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding SignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding Timestamp, Converter={StaticResource NullToVisibilityConverter}}"
                               >
                        <Run Text="@"/>
                        <Run Text="{Binding Timestamp, Converter={StaticResource DateTimeOffsetLongDateConverter}, ConverterParameter=F, Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding TimestampSignerInfo, Converter={StaticResource NullToVisibilityConverter}}"
                               >
                        <Run Text="by"/>
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding TimestampSignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding TimestampSignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                </StackPanel>
            </DataTemplate>


            <DataTemplate DataType="{x:Type nugetpe:RepositorySignatureInfo}">
                <StackPanel>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}" >
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding SignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding SignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding Timestamp, Converter={StaticResource NullToVisibilityConverter}}"
                    >
                        <Run Text="@"/>
                        <Run Text="{Binding Timestamp, Converter={StaticResource DateTimeOffsetLongDateConverter}, ConverterParameter=F, Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}"
                               Visibility="{Binding TimestampSignerInfo, Converter={StaticResource NullToVisibilityConverter}}"
                    >
                        <Run Text="by"/>
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding TimestampSignerInfo.Certificate, Mode=OneWay}">
                            <Run Text="{Binding TimestampSignerInfo.Certificate, Converter={StaticResource CertificateToSubjectConverter}, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}">
                        <Run Text="Owners: " /><Run Text="{Binding PackageOwners, Converter={StaticResource ListToStringConverter}, ConverterParameter=', ', Mode=OneWay}" />
                    </TextBlock>
                    <TextBlock Style="{StaticResource DetailMetadataValueStyle}">
                        <Run Text="Service Index: " /><Hyperlink Command="GoToPage" CommandParameter="{Binding V3ServiceIndexUrl, Mode=OneWay}">
                            <Run Text="{Binding V3ServiceIndexUrl, Mode=OneWay}" />
                        </Hyperlink>
                    </TextBlock>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type core:RepositoryMetadata}">
                <StackPanel>
                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Type, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryType}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Type}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Url, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryUrl}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Style="{StaticResource DetailMetadataValueStyle}">
                            <Hyperlink Command="GoToPage" CommandParameter="{Binding Url, Mode=OneWay}">
                                <Run Text="{Binding Url}" />
                            </Hyperlink>
                        </TextBlock>
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Branch, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryBranch}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Branch}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>


                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Commit, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryCommit}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Commit}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type packaging:LicenseMetadata}">
                <StackPanel>
                    <StackPanel Style="{StaticResource DetailMetadataStyle}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryType}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Type}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding License, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.PackageChooser_DetailLicense}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding License}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <TextBlock Visibility="{Binding LicenseUrl, Converter={StaticResource NullToVisibilityConverter}}">
                        <Hyperlink Command="GoToPage" CommandParameter="{Binding LicenseUrl}" ToolTip="{Binding LicenseUrl}">
                            <Run Text="{x:Static self:Resources.Dialog_ViewLicense}" />
                        </Hyperlink>
                    </TextBlock>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding LicenseExpression, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_LicenseExpressionVersion}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding Version}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>

                    <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding LicenseExpression, Converter={StaticResource NullToVisibilityConverter}}">
                        <TextBlock Text="{x:Static self:Resources.Dialog_LicenseExpression}" Style="{StaticResource DetailMetadataLabelStyle}" />
                        <TextBlock Text="{Binding LicenseExpression}" Style="{StaticResource DetailMetadataValueStyle}" />
                    </StackPanel>
                </StackPanel>
            </DataTemplate>

            <DataTemplate DataType="{x:Type packaging:PackageDependencyGroup}">
                <Grid Margin="0,0,0,8">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock Text="{Binding TargetFramework, TargetNullValue={x:Static self:Resources.NoFxDependencyGroup}}" FontWeight="SemiBold" TextWrapping="Wrap" />
                    <ItemsControl
                        x:Name="dependenciesList"
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        ItemsSource="{Binding Packages}" />

                    <TextBlock
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        Visibility="{Binding Items.Count, ElementName=dependenciesList, Converter={StaticResource invertedCountConverter}}"
                        Style="{StaticResource NoDependencyTextBoxStyle}" 
                        Text="{x:Static self:Resources.Dialog_NoDependencyLabel}">
                    </TextBlock>
                </Grid>
            </DataTemplate>
            
            <DataTemplate x:Key="FrameworkReferenceItemTemplate" DataType="{x:Type packaging:FrameworkReference}">
                <TextBlock Text="{Binding Name, Mode=OneWay}" TextTrimming="CharacterEllipsis" />
            </DataTemplate>
            
            <DataTemplate DataType="{x:Type packaging:FrameworkReferenceGroup}">
                <Grid Margin="0,0,0,8">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock Text="{Binding TargetFramework, TargetNullValue={x:Static self:Resources.NoFxDependencyGroup}}" FontWeight="SemiBold" TextWrapping="Wrap" />
                    <ItemsControl
                        x:Name="frameworkReferencesList"
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        ItemsSource="{Binding FrameworkReferences}"
                        ItemTemplate="{StaticResource FrameworkReferenceItemTemplate}" />
                </Grid>
            </DataTemplate>
  
            <DataTemplate x:Key="PackageReferenceItemTemplate">
                <TextBlock Text="{Binding Mode=OneWay}" TextTrimming="CharacterEllipsis" />
            </DataTemplate>

            <DataTemplate DataType="{x:Type packaging:PackageReferenceSet}">
                <Grid Margin="0,0,0,8">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <TextBlock Text="{Binding TargetFramework, TargetNullValue={x:Static self:Resources.NoFxDependencyGroup}}" FontWeight="SemiBold" TextWrapping="Wrap" />
                    <ItemsControl
                        x:Name="referencesList"
                        Grid.Row="1"
                        Margin="20,0,0,0"
                        ItemsSource="{Binding References}"
                        ItemTemplate="{StaticResource PackageReferenceItemTemplate}" />
                </Grid>
            </DataTemplate>

            <ContextMenu x:Key="SharedContextMenu" DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
                <MenuItem Header="_View Content" InputGestureText="Enter" Command="{Binding ViewCommand}" CommandParameter="{Binding}" FontWeight="SemiBold" />
                <MenuItem Header="_Open in Windows shell..." Command="{Binding OpenCommand}" CommandParameter="{Binding}" />
                <MenuItem Header="Open _with..." Command="{Binding OpenWithCommand}" CommandParameter="{Binding}" />
                <MenuItem Header="_Save As..." Command="{Binding SaveCommand}" CommandParameter="{Binding}" Icon="{StaticResource SaveAsIcon}" />
                <MenuItem Header="Copy" Command="Copy" Icon="{StaticResource CopyIcon}" />
                <Separator />
                <MenuItem Header="_Edit" Command="{Binding EditCommand}" CommandParameter="{Binding}" />
                <Separator />
                <MenuItem Header="_Rename..." InputGestureText="F2" Command="{Binding RenameCommand}" CommandParameter="{Binding}" />
                <MenuItem Header="Re_place with..." Command="{Binding ReplaceCommand}" CommandParameter="{Binding}" />
                <self:GrayscaleMenuItem Header="_Delete" InputGestureText="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding}">
                    <self:GrayscaleMenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource RemoveIcon}" />
                    </self:GrayscaleMenuItem.Icon>
                </self:GrayscaleMenuItem>
            </ContextMenu>

            <ContextMenu x:Key="FolderSharedContextMenu" Opened="PackageFolderContextMenu_Opened" DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">

                <self:GrayscaleMenuItem Header="Add .props file" Command="{Binding AddBuildFileCommand, Mode=OneWay}" CommandParameter=".props" Visibility="{Binding Path, Converter={StaticResource StringToVisibilityConverter}, ConverterParameter=build;build\\*}">
                    <MenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource PropertyIcon}" />
                    </MenuItem.Icon>
                </self:GrayscaleMenuItem>

                <self:GrayscaleMenuItem Header="Add .targets file" Command="{Binding AddBuildFileCommand, Mode=OneWay}" CommandParameter=".targets" Visibility="{Binding Path, Converter={StaticResource StringToVisibilityConverter}, ConverterParameter=build;build\\*}">
                    <MenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource PropertyIcon}" />
                    </MenuItem.Icon>
                </self:GrayscaleMenuItem>

                <Separator Visibility="{Binding Path, Converter={StaticResource StringToVisibilityConverter}, ConverterParameter=build;build\\*}" />

                <MenuItem Header="Add _New File..." Command="{Binding AddNewFileCommand}" CommandParameter="{Binding}" Icon="{StaticResource NewItemIcon}" />
                <MenuItem Header="_Add Existing File..." Command="{Binding AddContentFileCommand}" CommandParameter="{Binding}" Icon="{StaticResource AddItemIcon}" />
                <MenuItem Header="Add Ne_w Folder" Command="{Binding AddNewFolderCommand}" CommandParameter="{Binding}" Icon="{StaticResource AddFolderIcon}" />
                <MenuItem Header="Paste" Command="Paste" Icon="{StaticResource PasteIcon}" />
                <MenuItem Header="_Rename..." InputGestureText="F2" Command="{Binding RenameCommand}" CommandParameter="{Binding}" Icon="{StaticResource RenameIcon}" />
                <self:GrayscaleMenuItem Header="_Delete" InputGestureText="Delete" Command="{Binding DeleteCommand}" CommandParameter="{Binding}">
                    <self:GrayscaleMenuItem.Icon>
                        <self:GrayscaleContentPresenter Content="{StaticResource RemoveIcon}" />
                    </self:GrayscaleMenuItem.Icon>
                </self:GrayscaleMenuItem>
            </ContextMenu>

            <DataTemplate x:Key="SimpleTextItemTemplate">
                <TextBlock Text="{Binding}" TextTrimming="CharacterEllipsis" ToolTipService.ToolTip="{Binding}" />
            </DataTemplate>

            <!-- data template for the package details pane -->
            <DataTemplate x:Key="PackageDetailTemplate" DataType="{x:Type viewmodel:EditablePackageMetadata}">
                <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                    <StackPanel Margin="8">
                        <Border BorderBrush="{StaticResource {x:Static SystemColors.ActiveBorderBrushKey}}" BorderThickness="0.5" HorizontalAlignment="Left" Padding="2" Background="White" Margin="0,0,0,5" ToolTipService.ToolTip="{Binding IconUrl}" Visibility="{Binding IconUrl, Converter={StaticResource NullToVisibilityConverter}}">
                            <Image Source="{Binding IconUrl, TargetNullValue={x:Null}}" Width="32" Height="32" Stretch="Fill" StretchDirection="DownOnly" />
                        </Border>

                        <!-- Id -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_IdLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Id}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Version -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_VersionLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Version, Converter={StaticResource NuGetVersionConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                            <TextBlock Margin="3,0,0,0" Text="(prerelease)" Foreground="DarkRed" Visibility="{Binding Version, Mode=OneWay, Converter={StaticResource NuGetVersionPreReleaseConverter}}" />
                        </StackPanel>

                        <!-- Publisher -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" 
                                    Visibility="{Binding PublisherSignature, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_PublisherLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Content="{Binding PublisherSignature, Mode=OneWay}" />
                            
                        </StackPanel>

                        <!-- Repository -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" 
                                    Visibility="{Binding RepositorySignature, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Content="{Binding RepositorySignature, Mode=OneWay}" />

                        </StackPanel>
  
                        <!-- Validation -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" 
                                    Visibility="{Binding IsSigned, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_SignatureValidation}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Content="{Binding Mode=OneWay}" ContentTemplate="{StaticResource VerifySignaturesResult}" Margin="3,0,0,0" />
                        </StackPanel>

                        <!-- Title -->
                        <DockPanel Margin="0,3,0,0" Visibility="{Binding Title, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_TitleLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Title}" Style="{StaticResource DetailMetadataValueStyle}" TextTrimming="CharacterEllipsis" />
                        </DockPanel>

                        <!-- Authors -->
                        <DockPanel Margin="0,3,0,0">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_CreatedByLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Authors, Converter={StaticResource authorNamesConverter}}" Style="{StaticResource DetailMetadataValueStyle}" TextWrapping="Wrap" />
                        </DockPanel>

                        <!-- Owners -->
                        <DockPanel Margin="0,3,0,0" Visibility="{Binding Owners, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_OwnersLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Owners, Converter={StaticResource authorNamesConverter}}" Style="{StaticResource DetailMetadataValueStyle}" TextWrapping="Wrap" />
                        </DockPanel>

                        <!-- Min client version -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding MinClientVersion, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_MinVersionLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding MinClientVersion}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Development Dependency -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding DevelopmentDependency, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_DevelopmentDependencyLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding DevelopmentDependency, Converter={StaticResource BooleanConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Tags -->
                        <DockPanel Margin="0,3,0,0" Visibility="{Binding Tags, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock DockPanel.Dock="Left" Text="{x:Static self:Resources.Dialog_TagLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Tags}" Style="{StaticResource DetailMetadataValueStyle}" TextWrapping="Wrap" />
                        </DockPanel>

                        <!-- Language -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Language, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_LanguageLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Language}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Require License Acceptance -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding RequireLicenseAcceptance, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_RequireLicenseLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding RequireLicenseAcceptance, Converter={StaticResource BooleanConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- View License link -->
                        <TextBlock Visibility="{Binding LicenseUrl, Converter={StaticResource NullToVisibilityConverter}}">
                            <Hyperlink Command="GoToPage" CommandParameter="{Binding LicenseUrl}" ToolTip="{Binding LicenseUrl}">
                                <Run Text="{x:Static self:Resources.Dialog_ViewLicense}" />
                            </Hyperlink>
                        </TextBlock>

                        <!-- License Metadata -->
                        <StackPanel
                            Visibility="{Binding LicenseMetadata, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_LicenceMeta}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Margin="14,0,0,0" Content="{Binding LicenseMetadata, Mode=OneWay}" />
                        </StackPanel>

                        <!-- Project Url -->
                        <TextBlock Visibility="{Binding ProjectUrl, Converter={StaticResource NullToVisibilityConverter}}">
                            <Hyperlink Command="GoToPage" CommandParameter="{Binding ProjectUrl}" ToolTip="{Binding ProjectUrl}">
                                <Run Text="{x:Static self:Resources.Dialog_MoreInfo}" />
                            </Hyperlink>
                        </TextBlock>

                        <!-- Copyright -->
                        <TextBlock Text="Copyright:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}" Visibility="{Binding Copyright, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding Copyright, Converter={StaticResource NormalizeTextConverter}}" Visibility="{Binding Copyright, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <!-- Serviceable -->
                        <StackPanel Style="{StaticResource DetailMetadataStyle}" Visibility="{Binding Serviceable, Converter={StaticResource boolToVis}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_ServiceableLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />
                            <TextBlock Text="{Binding Serviceable, Converter={StaticResource BooleanConverter}}" Style="{StaticResource DetailMetadataValueStyle}" />
                        </StackPanel>

                        <!-- Repository -->
                        <StackPanel
                            Visibility="{Binding Repository, Converter={StaticResource NullToVisibilityConverter}}">
                            <TextBlock Text="{x:Static self:Resources.Dialog_RepositoryLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                            <ContentPresenter Margin="14,0,0,0" Content="{Binding Repository, Mode=OneWay}" />

                        </StackPanel>

                        <!-- Summary -->
                        <TextBlock Text="Summary:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}" Visibility="{Binding Summary, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding Summary, Converter={StaticResource NormalizeTextConverter}}" Visibility="{Binding Summary, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <!-- Description -->
                        <TextBlock Text="Description:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding Description, Converter={StaticResource NormalizeTextConverter}}"></TextBlock>

                        <!-- Release Notes -->
                        <TextBlock Text="Release notes:" Margin="0,3,0,0" Style="{StaticResource DetailMetadataLabelStyle}" Visibility="{Binding ReleaseNotes, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <TextBlock Style="{StaticResource DetailDescriptionTextBoxStyle}" Text="{Binding ReleaseNotes, Converter={StaticResource NormalizeTextConverter}}" Visibility="{Binding ReleaseNotes, Converter={StaticResource NullToVisibilityConverter}}"></TextBlock>

                        <!-- Dependencies list -->
                        <TextBlock Text="{x:Static self:Resources.Dialog_DependenciesLabel}" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="DependencyItems" Margin="25,5,0,0" ItemsSource="{Binding DependencySets, Converter={StaticResource DependencySetConverter}}">
                        </ItemsControl>

                        <TextBlock Margin="25,5,0,0" Visibility="{Binding Items.Count, ElementName=DependencyItems, Converter={StaticResource invertedCountConverter}}" Style="{StaticResource NoDependencyTextBoxStyle}" Text="{x:Static self:Resources.Dialog_NoDependencyLabel}"></TextBlock>

                        <!-- Framework assembly references -->
                        <TextBlock Visibility="{Binding Items.Count, ElementName=FrameworkAssemblyItems, Converter={StaticResource countConverter}}" Text="{x:Static self:Resources.Dialog_FrameworkAssembliesLabel}" Margin="0,5,0,0" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="FrameworkAssemblyItems" Margin="25,5,0,0" ItemsSource="{Binding FrameworkAssemblies}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate DataType="{x:Type packaging:FrameworkAssemblyReference}">
                                    <Grid Margin="0,4,0,0">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                        </Grid.ColumnDefinitions>

                                        <TextBlock Grid.Column="0" Margin="4,0,4,0" Text="{Binding Converter={StaticResource FrameworkAssemblyReferenceDisplayConverter}, ConverterParameter=includeAssembly}" TextTrimming="CharacterEllipsis" />
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>

                        <!-- Framework Reference Groups -->
                        <TextBlock Visibility="{Binding Items.Count, ElementName=FrameworkReferenceGroups, Converter={StaticResource countConverter}}" Text="Framework References:" Margin="0,5,0,0" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="FrameworkReferenceGroups" Margin="25,5,0,0" ItemsSource="{Binding FrameworkReferenceGroups}">
                        </ItemsControl>

                        <!-- Package Assembly References -->
                        <TextBlock Visibility="{Binding Items.Count, ElementName=PackageAssemblyReferences, Converter={StaticResource countConverter}}" Text="Filtered Assembly References:" Margin="0,5,0,0" Style="{StaticResource DetailMetadataLabelStyle}" />

                        <ItemsControl x:Name="PackageAssemblyReferences" Margin="25,5,0,0" ItemsSource="{Binding PackageAssemblyReferences, Converter={StaticResource ReferenceSetConverter}}">
                        </ItemsControl>
                       
                    </StackPanel>
{'fraction_non_alphanumeric': 0.1110420074902316, 'fraction_numerical': 0.004880818787772264, 'mean_word_length': 2.3362201172755976, 'pattern_counts': {'":': 0, '<': 770, '<?xml version=': 0, '>': 770, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2535578', 'n_tokens_mistral': 17313, 'n_tokens_neox': 15474, 'n_words': 2771}