AutoCatUwp/ACTerm/Program.cs

43 lines
1.1 KiB
C#

using System;
using Terminal.Gui;
using ACTerm.Views;
using System.Threading.Tasks;
using AutoCatCore.ViewModel;
namespace ACTerm
{
class Program
{
static async Task Main(string[] args)
{
Application.Init();
var authVM = new AuthViewModel(new DialogService());
await authVM.Init();
if (!authVM.isLoggedIn)
{
var loginDialog = AuthDialog.CreateNew(authVM);
Application.Top.Add(loginDialog);
}
else
{
//var mainWindow = new Window("Wnd");
//top.Add(mainWindow);
var history = new FrameView("History") { X = 0, Y = 0, Width = Dim.Percent(30), Height = Dim.Fill() - 1 };
var detail = new FrameView("Vehicle details") { X = Pos.Percent(30), Y = 0, Width = Dim.Percent(70), Height = Dim.Fill() - 1 };
// Statusbar
var about = new StatusItem(Key.F1, "~F1~ - About", () => { });
var quit = new StatusItem(Key.ControlQ, "~Ctrl+Q~ - Quit", () => { Application.Shutdown(); });
var statusBar = new StatusBar(new[] { about, quit });
Application.Top.Add(history, detail, statusBar);
Application.Top.StatusBar = statusBar;
}
Application.Run();
}
}
}