Show licenses in About view

Closes #4
This commit is contained in:
2026-03-03 11:10:56 +09:00
parent 94c8945140
commit 32228e143f
3 changed files with 460 additions and 0 deletions
+22
View File
@@ -1,4 +1,5 @@
using System;
using System.IO;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
@@ -10,6 +11,27 @@ namespace MayShow.Views
public AboutView()
{
this.InitializeComponent();
// set license text
var licenseFileName = "Assets/LICENSES.txt";
var licenseText = "";
if (File.Exists(licenseFileName))
{
licenseText = File.ReadAllText(licenseFileName);
}
else
{
licenseFileName = "../Resources/Assets/LICENSES.txt";
if (File.Exists(licenseFileName))
{
licenseText = File.ReadAllText(licenseFileName);
}
else
{
licenseText = "Error: Unable to find license file!";
}
}
LicenseTextBlock.Text = licenseText;
}
}
}