forked from NuGetPackageExplorer/NuGetPackageExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackageAnalyzerPane.xaml
More file actions
49 lines (43 loc) · 2.63 KB
/
Copy pathPackageAnalyzerPane.xaml
File metadata and controls
49 lines (43 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<UserControl x:Class="PackageExplorer.PackageAnalyzerPane" 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" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<DataTemplate x:Key="PackageIssueTemplate" DataType="types:PackageIssue">
<Expander Margin="0,5,0,0">
<Expander.Header>
<DockPanel>
<ContentControl x:Name="icon" Margin="0,0,3,0" DockPanel.Dock="Left" />
<TextBlock Text="{Binding Title, Mode=OneTime}" FontWeight="Bold" TextTrimming="CharacterEllipsis" />
</DockPanel>
</Expander.Header>
<StackPanel>
<TextBlock TextWrapping="Wrap" Margin="3,3,0,0">
<Run Text="Description:" FontWeight="Bold" />
<Run Text="{Binding Description, Mode=OneTime}" />
</TextBlock>
<TextBlock TextWrapping="Wrap" Margin="3,3,0,0">
<Run Text="Solution:" FontWeight="Bold" />
<Run Text="{Binding Solution, Mode=OneTime}" />
</TextBlock>
</StackPanel>
</Expander>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Level, Mode=OneWay}" Value="Warning">
<Setter TargetName="icon" Property="Content" Value="{StaticResource StatusWarningIcon}" />
</DataTrigger>
<DataTrigger Binding="{Binding Level, Mode=OneWay}" Value="Error">
<Setter TargetName="icon" Property="Content" Value="{StaticResource StatusCriticalErrorIcon}" />
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</UserControl.Resources>
<DockPanel>
<Border Padding="3" DockPanel.Dock="Top" Grid.Row="0" Background="#BCC7D8" BorderBrush="{StaticResource {x:Static SystemColors.ActiveBorderBrushKey}}">
<self:GrayscaleButton HorizontalAlignment="Left" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding ViewPackageAnalysisCommand, Mode=OneWay}" ToolTip="Rerun package analysis">
<self:GrayscaleContentPresenter Content="{StaticResource RefreshIcon}" />
</self:GrayscaleButton>
</Border>
<TextBlock Margin="8,10,5,3" DockPanel.Dock="Top" Text="{Binding PackageIssues.Count, Mode=OneWay, StringFormat='{}{0} issue(s) found.'}"></TextBlock>
<ScrollViewer Margin="5" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding PackageIssues, Mode=OneWay}" ItemTemplate="{StaticResource PackageIssueTemplate}"></ItemsControl>
</ScrollViewer>
</DockPanel>
</UserControl>