v1.1.0: 全面重构UI为Better-Seewo横版主窗口 (Fluent风格+圆角+动画), 新增非触摸大板支持与专业版激活, 更改菜单位置至ApplicationMenu/ExtendedTitleBar
This commit is contained in:
62
Better-EN5/UI/BetterSeewoMainWindow.xaml.cs
Normal file
62
Better-EN5/UI/BetterSeewoMainWindow.xaml.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
namespace BetterEN5.UI
|
||||
{
|
||||
public partial class BetterSeewoMainWindow : Window
|
||||
{
|
||||
public BetterSeewoMainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Loaded += OnLoaded;
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var storyboard = (Storyboard)Resources["ScaleInStoryboard"];
|
||||
BeginStoryboard(storyboard);
|
||||
}
|
||||
|
||||
private void Minimize_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowState = WindowState.Minimized;
|
||||
}
|
||||
|
||||
private void Maximize_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowState = WindowState == WindowState.Maximized
|
||||
? WindowState.Normal
|
||||
: WindowState.Maximized;
|
||||
}
|
||||
|
||||
private void Close_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
public void RefreshModule()
|
||||
{
|
||||
En5Module?.RefreshStatusAsync();
|
||||
}
|
||||
|
||||
public static void ShowWindow()
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
var existing = Application.Current.Windows.OfType<BetterSeewoMainWindow>().FirstOrDefault();
|
||||
if (existing != null)
|
||||
{
|
||||
if (existing.WindowState == WindowState.Minimized)
|
||||
existing.WindowState = WindowState.Normal;
|
||||
existing.Activate();
|
||||
return;
|
||||
}
|
||||
|
||||
var window = new BetterSeewoMainWindow();
|
||||
window.Show();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user