32 lines
744 B
C#
Raw Normal View History

using Avalonia;
using Avalonia.Controls;
using MsBox.Avalonia;
namespace EliteBGS;
public class Helper {
public static void MessageBox(Window owner, string caption, string text) {
var box = MessageBoxManager
.GetMessageBoxStandard(caption, text)
;
var result = box.ShowAsPopupAsync(owner);
result.Wait();
}
public static string? OpenFileDialog(Window owner) {
OpenFileDialog dlg = new OpenFileDialog();
dlg.AllowMultiple = false;
var result = dlg.ShowAsync(owner);
result.Wait();
var filename = result.Result;
if (filename == null || filename.Length <= 0) {
return null;
}
return filename[0];
}
}