wakka/MainWindow.xaml.cs
2025-05-08 22:16:00 -05:00

56 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace wakka
{
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
///
public sealed partial class MainWindow : Window
{
private static SshConnection Ssh { get; set; } = new SshConnection();
public Frame RootFrame;
public MainWindow()
{
this.InitializeComponent();
this.AppWindow.MoveAndResize(new Windows.Graphics.RectInt32(100, 100, 854, 480));
Ssh.DeleteSshKey();
RootFrame = rootFrame;
if (Ssh.KeyExists() & (string)App.LocalSettingsData.Values["username"] != null)
{
Ssh.InitializeConnection((string)App.LocalSettingsData.Values["username"]);
RootFrame.Content = new NavigationPage();
}
else
{
RootFrame.Content = new StartupSshPage();
}
}
//private void myButton_Click(object sender, RoutedEventArgs e)
//{
// myButton.Content = "Clicked";
//}
}
}