44using Microsoft . Windows . AppNotifications ;
55using Microsoft . Windows . AppNotifications . Builder ;
66using System ;
7+ using System . Collections . Generic ;
78using System . IO ;
89using System . Net . Http ;
910using Windows . ApplicationModel . DataTransfer ;
11+ using Windows . System ;
1012
1113namespace Edge
1214{
13- public sealed partial class AboutItem : Page
15+ public class OpenSource ( string uri , string name )
16+ {
17+ public string Uri = uri ;
18+ public string Name = name ;
19+ }
20+
21+ public sealed partial class About : Page
1422 {
1523 public string appVersion = File . ReadAllText ( "./Assets/version.txt" ) ;
16- public string browserVersion = CoreWebView2Environment . GetAvailableBrowserVersionString ( ) ;
24+ public string webViewVersion = CoreWebView2Environment . GetAvailableBrowserVersionString ( ) ;
1725
18- public AboutItem ( )
26+ public List < OpenSource > OpenSources = [ ] ;
27+
28+ public About ( )
1929 {
2030 this . InitializeComponent ( ) ;
31+ OpenSources =
32+ [
33+ new ( "https://github.com/CommunityToolkit/Windows" , "Windows Community Toolkit" ) ,
34+ new ( "https://aka.ms/webview" , "Microsoft.Web.WebView2" ) ,
35+ new ( "https://github.com/microsoft/windowsappsdk" , "Microsoft.WindowsAppSDK" ) ,
36+ new ( "https://aka.ms/WinSDKProjectURL" , "Microsoft.Windows.SDK.BuildTools" ) ,
37+ new ( "https://github.com/dotnet/runtime" , "System.Text.Encoding.CodePages" ) ,
38+ new ( "https://github.com/BreeceW/WinUIEdit" , "WinUIEdit" )
39+ ] ;
40+ }
41+
42+ private static void CopyText ( string text )
43+ {
44+ DataPackage package = new ( ) ;
45+ package . SetText ( text ) ;
46+ Clipboard . SetContent ( package ) ;
47+ }
48+
49+ private void CopyWebViewVersion ( object sender , RoutedEventArgs e )
50+ {
51+ CopyText ( webViewVersion ) ;
52+ }
53+
54+ private void CopyAppVersion ( object sender , RoutedEventArgs e )
55+ {
56+ CopyText ( appVersion ) ;
57+ }
58+
59+ private async void OpenRepoWebsite ( object sender , RoutedEventArgs e )
60+ {
61+ await Launcher . LaunchUriAsync ( new ( "https://github.com/wtcpython/WinUIEdge" ) ) ;
2162 }
2263
2364 private async void CheckUpdate ( object sender , RoutedEventArgs e )
@@ -43,29 +84,5 @@ private async void CheckUpdate(object sender, RoutedEventArgs e)
4384 }
4485 catch ( Exception ) { }
4586 }
46-
47- private static void CopyText ( string text )
48- {
49- DataPackage package = new ( ) ;
50- package . SetText ( text ) ;
51- Clipboard . SetContent ( package ) ;
52- }
53-
54- private void CopyChromiumVersion ( object sender , RoutedEventArgs e )
55- {
56- CopyText ( browserVersion ) ;
57- }
58-
59- private void CopyAppVersion ( object sender , RoutedEventArgs e )
60- {
61- CopyText ( appVersion ) ;
62- }
63-
64- private void OpenRepoWebsite ( object sender , RoutedEventArgs e )
65- {
66- MainWindow mainWindow = App . GetWindowForElement ( this ) ;
67- mainWindow . AddNewTab ( new WebViewPage ( new ( "https://github.com/wtcpython/WinUIEdge" ) ) ) ;
68- }
6987 }
7088}
71-
0 commit comments