mirror of
https://github.com/casksteven/Sweaty-Launcher.git
synced 2024-06-24 21:09:27 +00:00
54 lines
1.3 KiB
C#
54 lines
1.3 KiB
C#
using Launcher.Model;
|
|
using System;
|
|
using System.Globalization;
|
|
using System.Threading;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace Launcher
|
|
{
|
|
/// <summary>
|
|
/// MainWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
public static MainWindow Instance { get; private set; }
|
|
|
|
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
Instance = this;
|
|
|
|
}
|
|
|
|
protected override void OnSourceInitialized(EventArgs e)
|
|
{
|
|
base.OnSourceInitialized(e);
|
|
|
|
}
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
var lb = sender as ListBox;
|
|
|
|
if (rootFrame == null)
|
|
{
|
|
return;
|
|
}
|
|
switch (lb.SelectedIndex)
|
|
{
|
|
case 0: rootFrame.Navigate(new Uri("View/Home.xaml", UriKind.Relative)); break;
|
|
case 1: rootFrame.Navigate(new Uri("View/Setting.xaml", UriKind.Relative)); break;
|
|
case 2: rootFrame.Navigate(new Uri("View/About.xaml", UriKind.Relative)); break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|