mirror of
https://github.com/yaobiao131/downkyicore.git
synced 2025-08-10 00:52:31 +00:00
fix: 修复返回引用类型导致的设置保存失败
This commit is contained in:
@@ -6,4 +6,15 @@ public class WindowSettings
|
||||
public double Height { get; set; } = 750; // 默认高度
|
||||
public double X { get; set; } = double.NaN; // 默认位置未设置
|
||||
public double Y { get; set; } = double.NaN; // 默认位置未设置
|
||||
|
||||
public WindowSettings Clone()
|
||||
{
|
||||
return new WindowSettings
|
||||
{
|
||||
Width = Width,
|
||||
Height = Height,
|
||||
X = X,
|
||||
Y = Y
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,12 @@ namespace DownKyi.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
private readonly WindowSettings _windowSettings;
|
||||
private WindowSettings _windowSettings;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
_windowSettings = SettingsManager.GetInstance().GetWindowSettings();
|
||||
_windowSettings = SettingsManager.GetInstance().GetWindowSettings().Clone();
|
||||
ApplyWindowSettings();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user