52 lines
No EOL
1.5 KiB
C#
52 lines
No EOL
1.5 KiB
C#
using Avalonia.Controls;
|
|
using Avalonia.Layout;
|
|
|
|
namespace CatalogLite;
|
|
|
|
internal sealed class ExpiredWindow : Window
|
|
{
|
|
public ExpiredWindow(DateOnly? expirationDate)
|
|
{
|
|
Title = "Catalog Lite";
|
|
Width = 430;
|
|
Height = 190;
|
|
CanResize = false;
|
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
|
|
|
var message = expirationDate is null
|
|
? "L'applicazione e scaduta e non puo essere utilizzata."
|
|
: $"L'applicazione e scaduta il {expirationDate:dd/MM/yyyy} e non puo essere utilizzata.";
|
|
|
|
var closeButton = new Button
|
|
{
|
|
Content = "Chiudi",
|
|
HorizontalAlignment = HorizontalAlignment.Right,
|
|
MinWidth = 96
|
|
};
|
|
closeButton.Click += (_, _) => Close();
|
|
|
|
Content = new Border
|
|
{
|
|
Padding = new Avalonia.Thickness(22),
|
|
Child = new StackPanel
|
|
{
|
|
Spacing = 14,
|
|
Children =
|
|
{
|
|
new TextBlock
|
|
{
|
|
Text = "Applicazione scaduta",
|
|
FontSize = 18,
|
|
FontWeight = Avalonia.Media.FontWeight.SemiBold
|
|
},
|
|
new TextBlock
|
|
{
|
|
Text = message,
|
|
TextWrapping = Avalonia.Media.TextWrapping.Wrap
|
|
},
|
|
closeButton
|
|
}
|
|
}
|
|
};
|
|
}
|
|
} |