|
6 | 6 | xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" |
7 | 7 | xmlns:local="clr-namespace:CodeSnip.Views.AboutView" |
8 | 8 | d:DataContext="{d:DesignInstance Type=local:AboutWindowModel}" |
| 9 | + xmlns:sys="clr-namespace:System;assembly=mscorlib" |
9 | 10 | mc:Ignorable="d" |
10 | 11 | Title="About" Height="400" Width="600" |
11 | 12 | ShowInTaskbar="False" ResizeMode="NoResize" WindowStartupLocation="CenterOwner" > |
12 | | - <mah:MetroWindow.Resources> |
| 13 | + <mah:MetroWindow.Resources> |
| 14 | + <x:Array x:Key="Libraries" Type="{x:Type local:DependencyInfo}"> |
| 15 | + <local:DependencyInfo Name="AvalonEdit" Url="https://github.com/icsharpcode/AvalonEdit" LicenseName="MIT License" LicenseUrl="https://github.com/icsharpcode/AvalonEdit/blob/master/LICENSE" /> |
| 16 | + <local:DependencyInfo Name="CommunityToolkit.Mvvm" Url="https://github.com/CommunityToolkit/dotnet" LicenseName="MIT License" LicenseUrl="https://github.com/CommunityToolkit/dotnet/blob/main/License.md" /> |
| 17 | + <local:DependencyInfo Name="CSharpier.Core" Url="https://csharpier.com/" LicenseName="MIT License" LicenseUrl="https://github.com/belav/csharpier/blob/main/LICENSE" /> |
| 18 | + <local:DependencyInfo Name="Dapper" Url="https://github.com/DapperLib/Dapper" LicenseName="Apache 2.0 License" LicenseUrl="https://github.com/DapperLib/Dapper/blob/main/License.txt" /> |
| 19 | + <local:DependencyInfo Name="MahApps.Metro" Url="https://github.com/MahApps/MahApps.Metro" LicenseName="MIT License" LicenseUrl="https://github.com/MahApps/MahApps.Metro/blob/develop/LICENSE" /> |
| 20 | + <local:DependencyInfo Name="System.Data.SQLite.Core" Url="https://system.data.sqlite.org/" LicenseName="Public Domain" LicenseUrl="https://system.data.sqlite.org/home/doc/trunk/www/copyright.wiki" /> |
| 21 | + </x:Array> |
13 | 22 |
|
14 | | - </mah:MetroWindow.Resources> |
15 | | - <Grid> |
16 | | - <mah:MetroTabControl TabStripPlacement="Left" Style="{StaticResource MahApps.Styles.TabControl.Animated}" mah:HeaderedControlHelper.HeaderFontSize="18"> |
| 23 | + <x:Array x:Key="Services" Type="{x:Type local:DependencyInfo}"> |
| 24 | + <local:DependencyInfo Name="Compiler Explorer" Url="https://godbolt.org/" LicenseName="BSD 2-Clause" LicenseUrl="https://github.com/compiler-explorer/compiler-explorer/blob/main/LICENSE" /> |
| 25 | + </x:Array> |
17 | 26 |
|
18 | | - <mah:MetroTabItem Header="About"> |
19 | | - <StackPanel Margin="20" HorizontalAlignment="Center"> |
| 27 | + <x:Array x:Key="Tools" Type="{x:Type local:DependencyInfo}"> |
| 28 | + <local:DependencyInfo Name="black" Url="https://black.readthedocs.io/en/stable/" LicenseName="MIT License" LicenseUrl="https://github.com/psf/black/blob/main/LICENSE" /> |
| 29 | + <local:DependencyInfo Name="clang-format" Url="https://clang.llvm.org/docs/ClangFormat.html" LicenseName="NCSA Open Source License" LicenseUrl="https://llvm.org/docs/DeveloperPolicy.html#license" /> |
| 30 | + <local:DependencyInfo Name="dfmt" Url="https://github.com/dlang-community/dfmt" LicenseName="Boost Software License" LicenseUrl="https://github.com/dlang-community/dfmt/blob/master/LICENSE.txt" /> |
| 31 | + <local:DependencyInfo Name="rustfmt" Url="https://github.com/rust-lang/rustfmt" LicenseName="MIT/Apache-2.0 License" LicenseUrl="https://github.com/rust-lang/rustfmt/blob/master/LICENSE-MIT" /> |
| 32 | + <local:DependencyInfo Name="ruff" Url="https://docs.astral.sh/ruff/" LicenseName="MIT License" LicenseUrl="https://github.com/astral-sh/ruff/blob/main/LICENSE" /> |
| 33 | + </x:Array> |
| 34 | + </mah:MetroWindow.Resources> |
| 35 | + <Grid> |
| 36 | + <mah:MetroTabControl TabStripPlacement="Left" Style="{StaticResource MahApps.Styles.TabControl.Animated}" mah:HeaderedControlHelper.HeaderFontSize="18"> |
20 | 37 |
|
21 | | - <TextBlock Text="{Binding Title}" |
22 | | - FontWeight="Bold" |
23 | | - FontSize="22" |
24 | | - Foreground="{DynamicResource MahApps.Brushes.Accent}" |
| 38 | + <mah:MetroTabItem Header="About"> |
| 39 | + <StackPanel Margin="20" HorizontalAlignment="Center"> |
| 40 | + |
| 41 | + <TextBlock Text="{Binding Title}" |
| 42 | + FontWeight="Bold" |
| 43 | + FontSize="22" |
| 44 | + Foreground="{DynamicResource MahApps.Brushes.Accent}" |
25 | 45 | HorizontalAlignment="Center" /> |
26 | 46 |
|
27 | | - <TextBlock Text="Version:" FontWeight="SemiBold" Margin="0,20,0,0" /> |
28 | | - <TextBlock Text="{Binding Version}" FontSize="14" /> |
| 47 | + <TextBlock Text="Version:" FontWeight="SemiBold" Margin="0,20,0,0" /> |
| 48 | + <TextBlock Text="{Binding Version}" FontSize="14" /> |
29 | 49 |
|
30 | | - <TextBlock Text="Description:" FontWeight="SemiBold" Margin="0,15,0,0" /> |
31 | | - <TextBlock Text="{Binding Description}" |
32 | | - TextWrapping="Wrap" |
33 | | - FontSize="13" |
| 50 | + <TextBlock Text="Description:" FontWeight="SemiBold" Margin="0,15,0,0" /> |
| 51 | + <TextBlock Text="{Binding Description}" |
| 52 | + TextWrapping="Wrap" |
| 53 | + FontSize="13" |
34 | 54 | Foreground="{DynamicResource MahApps.Brushes.Gray}" /> |
35 | 55 |
|
36 | | - <TextBlock Text="Author:" FontWeight="SemiBold" Margin="0,15,0,0" /> |
37 | | - <TextBlock Text="{Binding Company}" FontSize="14" /> |
38 | | - <TextBlock Text="{Binding Copyright}" FontSize="14" Margin="0,15,0,0" /> |
| 56 | + <TextBlock Text="Author:" FontWeight="SemiBold" Margin="0,15,0,0" /> |
| 57 | + <TextBlock Text="{Binding Company}" FontSize="14" /> |
| 58 | + <TextBlock Text="{Binding Copyright}" FontSize="14" Margin="0,15,0,0" /> |
39 | 59 |
|
40 | | - <TextBlock Margin="15,30,0,0" HorizontalAlignment="Center" FontSize="14" ToolTip="{Binding Url}"> |
41 | | - <Run Text="Repository: " /> |
42 | | - <Hyperlink NavigateUri="https://github.com/mx7b7/codesnip-wpf/" |
43 | | - RequestNavigate="Hyperlink_RequestNavigate"> |
44 | | - <Run Text="GitHub" /> |
45 | | - </Hyperlink> |
46 | | - </TextBlock> |
47 | | - </StackPanel> |
48 | | - </mah:MetroTabItem> |
| 60 | + <TextBlock Margin="15,30,0,0" HorizontalAlignment="Center" FontSize="14" ToolTip="https://github.com/mx7b7/codesnip-wpf/"> |
| 61 | + <Run Text="Repository: " /> |
| 62 | + <Hyperlink NavigateUri="https://github.com/mx7b7/codesnip-wpf/" |
| 63 | + RequestNavigate="Hyperlink_RequestNavigate"> |
| 64 | + <Run Text="GitHub" /> |
| 65 | + </Hyperlink> |
| 66 | + </TextBlock> |
| 67 | + </StackPanel> |
| 68 | + </mah:MetroTabItem> |
49 | 69 |
|
50 | | - <mah:MetroTabItem Header="Dependencies & Tools"> |
51 | | - <ScrollViewer Margin="10" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> |
52 | | - <StackPanel> |
| 70 | + <mah:MetroTabItem Header="Dependencies & Tools"> |
| 71 | + <ScrollViewer Margin="10" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> |
| 72 | + <StackPanel> |
53 | 73 |
|
54 | | - <mah:MetroHeader Content="Libraries" |
55 | | - FontWeight="Bold" |
56 | | - FontSize="16" |
57 | | - Foreground="{DynamicResource MahApps.Brushes.Accent}" |
| 74 | + <mah:MetroHeader Content="Libraries" |
| 75 | + FontWeight="Bold" |
| 76 | + FontSize="16" |
| 77 | + Foreground="{DynamicResource MahApps.Brushes.Accent}" |
58 | 78 | Margin="0,0,0,10"/> |
59 | 79 |
|
60 | | - <ItemsControl ItemsSource="{Binding Libraries}"> |
61 | | - <ItemsControl.ItemTemplate> |
62 | | - <DataTemplate> |
63 | | - <Grid Margin="0,5" VerticalAlignment="Center"> |
64 | | - <Grid.ColumnDefinitions> |
65 | | - <ColumnDefinition Width="10"/> |
66 | | - <ColumnDefinition Width="*"/> |
67 | | - <ColumnDefinition Width="200"/> |
68 | | - </Grid.ColumnDefinitions> |
69 | | - <TextBlock Grid.Column="0" Text="•" FontSize="16" VerticalAlignment="Center" /> |
70 | | - <TextBlock Grid.Column="1" ToolTip="{Binding Url}" VerticalAlignment="Center"> |
71 | | - <Hyperlink NavigateUri="{Binding Url}" RequestNavigate="Hyperlink_RequestNavigate"> |
72 | | - <Run Text="{Binding Name}" /> |
73 | | - </Hyperlink> |
74 | | - </TextBlock> |
75 | | - <TextBlock Grid.Column="2" ToolTip="{Binding LicenseUrl}" VerticalAlignment="Center"> |
76 | | - <Hyperlink NavigateUri="{Binding LicenseUrl}" RequestNavigate="Hyperlink_RequestNavigate" > |
77 | | - <Run Text="{Binding LicenseName}" /> |
78 | | - </Hyperlink> |
79 | | - </TextBlock> |
80 | | - </Grid> |
81 | | - </DataTemplate> |
82 | | - </ItemsControl.ItemTemplate> |
83 | | - </ItemsControl> |
| 80 | + <ItemsControl ItemsSource="{StaticResource Libraries}"> |
| 81 | + <ItemsControl.ItemTemplate> |
| 82 | + <DataTemplate> |
| 83 | + <Grid Margin="0,5" VerticalAlignment="Center"> |
| 84 | + <Grid.ColumnDefinitions> |
| 85 | + <ColumnDefinition Width="10"/> |
| 86 | + <ColumnDefinition Width="*"/> |
| 87 | + <ColumnDefinition Width="200"/> |
| 88 | + </Grid.ColumnDefinitions> |
| 89 | + <TextBlock Grid.Column="0" Text="•" FontSize="16" VerticalAlignment="Center" /> |
| 90 | + <TextBlock Grid.Column="1" ToolTip="{Binding Url}" VerticalAlignment="Center"> |
| 91 | + <Hyperlink NavigateUri="{Binding Url}" RequestNavigate="Hyperlink_RequestNavigate"> |
| 92 | + <Run Text="{Binding Name}" /> |
| 93 | + </Hyperlink> |
| 94 | + </TextBlock> |
| 95 | + <TextBlock Grid.Column="2" ToolTip="{Binding LicenseUrl}" VerticalAlignment="Center"> |
| 96 | + <Hyperlink NavigateUri="{Binding LicenseUrl}" RequestNavigate="Hyperlink_RequestNavigate" > |
| 97 | + <Run Text="{Binding LicenseName}" /> |
| 98 | + </Hyperlink> |
| 99 | + </TextBlock> |
| 100 | + </Grid> |
| 101 | + </DataTemplate> |
| 102 | + </ItemsControl.ItemTemplate> |
| 103 | + </ItemsControl> |
84 | 104 |
|
85 | | - <mah:MetroHeader Content="External Services" |
86 | | - FontWeight="Bold" |
87 | | - FontSize="16" |
88 | | - Foreground="{DynamicResource MahApps.Brushes.Accent}" |
| 105 | + <mah:MetroHeader Content="External Services" |
| 106 | + FontWeight="Bold" |
| 107 | + FontSize="16" |
| 108 | + Foreground="{DynamicResource MahApps.Brushes.Accent}" |
89 | 109 | Margin="0,20,0,10"/> |
90 | 110 |
|
91 | | - <ItemsControl ItemsSource="{Binding Services}"> |
92 | | - <ItemsControl.ItemTemplate> |
93 | | - <DataTemplate> |
94 | | - <Grid Margin="0,5" VerticalAlignment="Center"> |
95 | | - <Grid.ColumnDefinitions> |
96 | | - <ColumnDefinition Width="10"/> |
97 | | - <ColumnDefinition Width="*"/> |
98 | | - <ColumnDefinition Width="200"/> |
99 | | - </Grid.ColumnDefinitions> |
100 | | - <TextBlock Grid.Column="0" Text="•" FontSize="16" VerticalAlignment="Center" /> |
101 | | - <TextBlock Grid.Column="1" ToolTip="{Binding Url}" VerticalAlignment="Center"> |
102 | | - <Hyperlink NavigateUri="{Binding Url}" RequestNavigate="Hyperlink_RequestNavigate"> |
103 | | - <Run Text="{Binding Name}" /> |
104 | | - </Hyperlink> |
105 | | - </TextBlock> |
106 | | - <TextBlock Grid.Column="2" ToolTip="{Binding LicenseUrl}" VerticalAlignment="Center"> |
107 | | - <Hyperlink NavigateUri="{Binding LicenseUrl}" RequestNavigate="Hyperlink_RequestNavigate" > |
108 | | - <Run Text="{Binding LicenseName}" /> |
109 | | - </Hyperlink> |
110 | | - </TextBlock> |
111 | | - </Grid> |
112 | | - </DataTemplate> |
113 | | - </ItemsControl.ItemTemplate> |
114 | | - </ItemsControl> |
| 111 | + <ItemsControl ItemsSource="{StaticResource Services}"> |
| 112 | + <ItemsControl.ItemTemplate> |
| 113 | + <DataTemplate> |
| 114 | + <Grid Margin="0,5" VerticalAlignment="Center"> |
| 115 | + <Grid.ColumnDefinitions> |
| 116 | + <ColumnDefinition Width="10"/> |
| 117 | + <ColumnDefinition Width="*"/> |
| 118 | + <ColumnDefinition Width="200"/> |
| 119 | + </Grid.ColumnDefinitions> |
| 120 | + <TextBlock Grid.Column="0" Text="•" FontSize="16" VerticalAlignment="Center" /> |
| 121 | + <TextBlock Grid.Column="1" ToolTip="{Binding Url}" VerticalAlignment="Center"> |
| 122 | + <Hyperlink NavigateUri="{Binding Url}" RequestNavigate="Hyperlink_RequestNavigate"> |
| 123 | + <Run Text="{Binding Name}" /> |
| 124 | + </Hyperlink> |
| 125 | + </TextBlock> |
| 126 | + <TextBlock Grid.Column="2" ToolTip="{Binding LicenseUrl}" VerticalAlignment="Center"> |
| 127 | + <Hyperlink NavigateUri="{Binding LicenseUrl}" RequestNavigate="Hyperlink_RequestNavigate" > |
| 128 | + <Run Text="{Binding LicenseName}" /> |
| 129 | + </Hyperlink> |
| 130 | + </TextBlock> |
| 131 | + </Grid> |
| 132 | + </DataTemplate> |
| 133 | + </ItemsControl.ItemTemplate> |
| 134 | + </ItemsControl> |
115 | 135 |
|
116 | | - <mah:MetroHeader Content="External Tools" |
117 | | - FontWeight="Bold" |
118 | | - FontSize="16" |
119 | | - Foreground="{DynamicResource MahApps.Brushes.Accent}" |
| 136 | + <mah:MetroHeader Content="External Tools" |
| 137 | + FontWeight="Bold" |
| 138 | + FontSize="16" |
| 139 | + Foreground="{DynamicResource MahApps.Brushes.Accent}" |
120 | 140 | Margin="0,20,0,10"/> |
121 | | - <ItemsControl ItemsSource="{Binding Tools}"> |
122 | | - <ItemsControl.ItemTemplate> |
123 | | - <DataTemplate> |
124 | | - <Grid Margin="0,5" VerticalAlignment="Center"> |
125 | | - <Grid.ColumnDefinitions> |
126 | | - <ColumnDefinition Width="10"/> |
127 | | - <ColumnDefinition Width="*"/> |
128 | | - <ColumnDefinition Width="200"/> |
129 | | - </Grid.ColumnDefinitions> |
130 | | - <TextBlock Grid.Column="0" Text="•" FontSize="16" VerticalAlignment="Center" /> |
131 | | - <TextBlock Grid.Column="1" ToolTip="{Binding Url}" VerticalAlignment="Center"> |
132 | | - <Hyperlink NavigateUri="{Binding Url}" RequestNavigate="Hyperlink_RequestNavigate"> |
133 | | - <Run Text="{Binding Name}" /> |
134 | | - </Hyperlink> |
135 | | - </TextBlock> |
136 | | - <TextBlock Grid.Column="2" ToolTip="{Binding LicenseUrl}" VerticalAlignment="Center"> |
137 | | - <Hyperlink NavigateUri="{Binding LicenseUrl}" RequestNavigate="Hyperlink_RequestNavigate" > |
138 | | - <Run Text="{Binding LicenseName}" /> |
139 | | - </Hyperlink> |
140 | | - </TextBlock> |
141 | | - </Grid> |
142 | | - </DataTemplate> |
143 | | - </ItemsControl.ItemTemplate> |
144 | | - </ItemsControl> |
145 | | - </StackPanel> |
146 | | - </ScrollViewer> |
147 | | - </mah:MetroTabItem> |
| 141 | + <ItemsControl ItemsSource="{StaticResource Tools}"> |
| 142 | + <ItemsControl.ItemTemplate> |
| 143 | + <DataTemplate> |
| 144 | + <Grid Margin="0,5" VerticalAlignment="Center"> |
| 145 | + <Grid.ColumnDefinitions> |
| 146 | + <ColumnDefinition Width="10"/> |
| 147 | + <ColumnDefinition Width="*"/> |
| 148 | + <ColumnDefinition Width="200"/> |
| 149 | + </Grid.ColumnDefinitions> |
| 150 | + <TextBlock Grid.Column="0" Text="•" FontSize="16" VerticalAlignment="Center" /> |
| 151 | + <TextBlock Grid.Column="1" ToolTip="{Binding Url}" VerticalAlignment="Center"> |
| 152 | + <Hyperlink NavigateUri="{Binding Url}" RequestNavigate="Hyperlink_RequestNavigate"> |
| 153 | + <Run Text="{Binding Name}" /> |
| 154 | + </Hyperlink> |
| 155 | + </TextBlock> |
| 156 | + <TextBlock Grid.Column="2" ToolTip="{Binding LicenseUrl}" VerticalAlignment="Center"> |
| 157 | + <Hyperlink NavigateUri="{Binding LicenseUrl}" RequestNavigate="Hyperlink_RequestNavigate" > |
| 158 | + <Run Text="{Binding LicenseName}" /> |
| 159 | + </Hyperlink> |
| 160 | + </TextBlock> |
| 161 | + </Grid> |
| 162 | + </DataTemplate> |
| 163 | + </ItemsControl.ItemTemplate> |
| 164 | + </ItemsControl> |
| 165 | + </StackPanel> |
| 166 | + </ScrollViewer> |
| 167 | + </mah:MetroTabItem> |
148 | 168 |
|
149 | | - <mah:MetroTabItem Header="Notes" Visibility="Collapsed"> |
150 | | - <!-- Usage tips --> |
151 | | - </mah:MetroTabItem> |
152 | | - </mah:MetroTabControl> |
153 | | - </Grid> |
| 169 | + <mah:MetroTabItem Header="Notes" Visibility="Collapsed"> |
| 170 | + <!-- Usage tips --> |
| 171 | + </mah:MetroTabItem> |
| 172 | + </mah:MetroTabControl> |
| 173 | + </Grid> |
154 | 174 | </mah:MetroWindow> |
0 commit comments