大量更新

This commit is contained in:
GG Z
2025-12-23 21:37:02 +08:00
parent 3fc465959b
commit b611efeed9
105 changed files with 5814 additions and 371 deletions

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
@@ -219,5 +216,21 @@ namespace Szmedi.Toolkit.Assists
};
window.Show();
}
public static void ShowDialog<TWindow, TViewModel>(params object[] viewModelParams)
where TWindow : Window, new()
where TViewModel : class
{
var window = new TWindow();
if (viewModelParams.Length == 0)
{
window.DataContext = Activator.CreateInstance(typeof(TViewModel));
}
else
{
window.DataContext = Activator.CreateInstance(typeof(TViewModel), viewModelParams);
}
_ = new WindowInteropHelper(window) { Owner = System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle };
window.ShowDialog();
}
}
}