-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDirectoryView.xaml
123 lines (123 loc) · 7.43 KB
/
DirectoryView.xaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<Window
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:LicenseMe"
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
x:Class="LicenseMe.DirectoryView"
mc:Ignorable="d"
Title="Git Repositories Found" Height="450" Width="800">
<Window.Resources>
<Style x:Key="CenterIt" TargetType="ListViewItem" >
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</Window.Resources>
<Grid>
<ListView x:Name="GitGrid">
<ListView.Resources>
<local:GitDirectory x:Key="GitDirectory" />
</ListView.Resources>
<ListView.DataContext>
<Binding Source="{StaticResource GitDirectory}"></Binding>
</ListView.DataContext>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem x:Name="AddLicense" Header="Add License" Click="AddLicenseC" />
<MenuItem x:Name="RemoveLicense" Header="Remove License" Click="RemoveLicenseC" />
<Separator />
<MenuItem x:Name="AddReadme" Header="Add Readme" Click="AddReadmeC" />
<MenuItem x:Name="RemoveReadme" Header="Remove Readme" Click="RemoveReadmeC" />
<Separator />
<MenuItem x:Name="OpenExplorer" Header="Open Path in Explorer" Click="OpenExplorerClick" />
</ContextMenu>
</ListView.ContextMenu>
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Width="160" Header="Repository Name">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock.ToolTip>
<ToolTip>
<TextBlock Text="{Binding Name}" />
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate></GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="350" Header="Repository Path">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding DisplayPath}" HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock.ToolTip>
<ToolTip>
<TextBlock Text="{Binding Path}" />
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="60" Header="License" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<DockPanel.Style>
<Style TargetType="DockPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding HasLicense}" Value="true">
<Setter Property="Background" Value="LightGreen"/>
</DataTrigger>
<DataTrigger Binding="{Binding HasLicense}" Value="false">
<Setter Property="Background" Value="IndianRed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
<CheckBox IsEnabled="False" IsChecked="{Binding HasLicense, Mode=OneWay}"></CheckBox>
</DockPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="60" Header="Readme" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<DockPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<DockPanel.Style>
<Style TargetType="DockPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding HasReadme}" Value="true">
<Setter Property="Background" Value="LightGreen"/>
</DataTrigger>
<DataTrigger Binding="{Binding HasReadme}" Value="false">
<Setter Property="Background" Value="IndianRed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DockPanel.Style>
<CheckBox IsEnabled="False" IsChecked="{Binding HasReadme}"></CheckBox>
</DockPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="120" Header="License Type"
DisplayMemberBinding="{Binding LicenseType.Name,FallbackValue='None or Unknown'}"/>
<!-- <GridViewColumn> -->
<!-- <GridViewColumn.CellTemplate> -->
<!-- <DataTemplate> -->
<!-- <Button Content="Click me Once" Click="AddLicenseButton"/> -->
<!-- </DataTemplate> -->
<!-- </GridViewColumn.CellTemplate> -->
<!-- </GridViewColumn> -->
</GridView.Columns>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Window>