2026-04-28 10:23:58 +08:00
|
|
|
|
using System.Windows.Controls;
|
2026-04-30 15:28:20 +08:00
|
|
|
|
using System.Windows;
|
2026-04-28 10:23:58 +08:00
|
|
|
|
|
|
|
|
|
|
namespace YY.Admin.Views.Dialogs
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// ServerSettingsDialogView.xaml 的交互逻辑
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class ServerSettingsDialogView : UserControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public ServerSettingsDialogView()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
2026-04-30 15:28:20 +08:00
|
|
|
|
|
|
|
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var win = Window.GetWindow(this);
|
|
|
|
|
|
if (win == null) return;
|
|
|
|
|
|
|
|
|
|
|
|
// 必须先关闭 AllowsTransparency,再改 WindowStyle(否则会抛出:
|
|
|
|
|
|
// 「当 AllowsTransparency 为 true 时,WindowStyle.None 是唯一有效值」)
|
|
|
|
|
|
win.AllowsTransparency = false;
|
|
|
|
|
|
win.WindowStyle = WindowStyle.SingleBorderWindow;
|
|
|
|
|
|
win.ResizeMode = ResizeMode.CanResizeWithGrip;
|
|
|
|
|
|
win.SizeToContent = SizeToContent.Manual;
|
|
|
|
|
|
win.MinWidth = 520;
|
|
|
|
|
|
win.MinHeight = 420;
|
|
|
|
|
|
if (win.Width < 520) win.Width = 520;
|
|
|
|
|
|
if (win.Height < 420) win.Height = 420;
|
|
|
|
|
|
}
|
2026-04-28 10:23:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|