mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
refactors and more UI
This commit is contained in:
+21
-2
@@ -1,14 +1,21 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Styling;
|
||||
using Avalonia.Threading;
|
||||
using MercuryConverter.UI.Dialogs;
|
||||
using MercuryConverter.UI.Views;
|
||||
|
||||
namespace MercuryConverter.UI;
|
||||
|
||||
using MercuryConverter.UI.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public static MainWindow? Instance { get; private set; }
|
||||
private bool initialShown = false;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
Instance = this;
|
||||
InitializeComponent();
|
||||
|
||||
// Force dark mode in designer
|
||||
@@ -19,5 +26,17 @@ public partial class MainWindow : Window
|
||||
|
||||
// Setup tab views
|
||||
SelectionControl.Content = new Selection();
|
||||
|
||||
// Show dialog on startup
|
||||
Activated += OnActivated;
|
||||
}
|
||||
|
||||
private void OnActivated(object? sender, EventArgs e)
|
||||
{
|
||||
if (initialShown) return;
|
||||
initialShown = true;
|
||||
|
||||
Dialog.DialogContent = new Welcome().Content;
|
||||
Dialog.IsOpen = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user