KernelOutputKeywordEdit.xaml.cs 1.1 KB

1234567891011121314151617181920212223242526272829
  1. using NTMiner.Vms;
  2. using System.Windows.Controls;
  3. namespace NTMiner.Views.Ucs {
  4. public partial class KernelOutputKeywordEdit : UserControl {
  5. public static void ShowWindow(FormType formType, KernelOutputKeywordViewModel data) {
  6. ContainerWindow.ShowWindow(new ContainerWindowViewModel {
  7. Title = $"内核输出关键字({(DevMode.IsDevMode ? "服务器" : "自定义")})",
  8. IsMaskTheParent = true,
  9. Width = 540,
  10. FormType = formType,
  11. CloseVisible = System.Windows.Visibility.Visible
  12. }, ucFactory: (window) =>
  13. {
  14. KernelOutputKeywordViewModel vm = new KernelOutputKeywordViewModel(data);
  15. window.BuildCloseWindowOnecePath(vm.Id);
  16. return new KernelOutputKeywordEdit(vm);
  17. }, fixedSize: true);
  18. }
  19. public KernelOutputKeywordViewModel Vm { get; private set; }
  20. public KernelOutputKeywordEdit(KernelOutputKeywordViewModel vm) {
  21. this.Vm = vm;
  22. this.DataContext = vm;
  23. InitializeComponent();
  24. }
  25. }
  26. }