示例#1
0
 public static void ShowWindow()
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title        = "收益计算器设置",
         IconName     = "Icon_Calc",
         Width        = 500,
         Height       = 450,
         CloseVisible = System.Windows.Visibility.Visible,
         SaveVisible  = System.Windows.Visibility.Visible,
         OnOk         = (uc) => {
             CalcConfigViewModels vm = (CalcConfigViewModels)uc.DataContext;
             NTMinerRoot.Current.CalcConfigSet.SaveCalcConfigs(vm.CalcConfigVms.Select(a => new CalcConfigData(a)).ToList());
             TopWindow.GetTopWindow()?.Close();
             return(true);
         }
     }, ucFactory: (window) => {
         var uc = new CalcConfig();
         uc.ItemsControl.MouseDown += (object sender, System.Windows.Input.MouseButtonEventArgs e) => {
             if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
             {
                 window.DragMove();
             }
         };
         return(uc);
     }, fixedSize: false);
 }
示例#2
0
 public static void ShowWindow()
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         IconName     = "Icon_Calc",
         CloseVisible = System.Windows.Visibility.Visible
     }, ucFactory: (window) => {
         var uc = new CalcConfig();
         CalcConfigViewModels vm    = (CalcConfigViewModels)uc.DataContext;
         vm.CloseWindow             = () => window.Close();
         uc.ItemsControl.MouseDown += (object sender, System.Windows.Input.MouseButtonEventArgs e) => {
             if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
             {
                 window.DragMove();
             }
         };
         return(uc);
     }, fixedSize: true);
 }
示例#3
0
 public static void ShowWindow()
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title        = "收益计算器设置",
         IconName     = "Icon_Calc",
         Width        = 600,
         Height       = 600,
         CloseVisible = Visibility.Visible
     }, ucFactory: (window) => {
         var uc                     = new CalcConfig();
         uc.Vm.CloseWindow          = window.Close;
         uc.ItemsControl.MouseDown += (object sender, MouseButtonEventArgs e) => {
             if (e.LeftButton == MouseButtonState.Pressed)
             {
                 window.DragMove();
             }
         };
         return(uc);
     }, fixedSize: true);
 }
示例#4
0
 public static void ShowWindow()
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title        = "收益计算器设置",
         IconName     = "Icon_Calc",
         Width        = 600,
         Height       = 600,
         CloseVisible = Visibility.Visible
     }, ucFactory: (window) => {
         var uc = new CalcConfig();
         window.AddOnecePath <CloseWindowCommand>("处理关闭窗口命令", LogEnum.DevConsole, action: message => {
             window.Close();
         }, pathId: uc.Vm.Id, location: typeof(CalcConfig));
         uc.ItemsControl.MouseDown += (object sender, MouseButtonEventArgs e) => {
             if (e.LeftButton == MouseButtonState.Pressed)
             {
                 window.DragMove();
             }
         };
         return(uc);
     }, fixedSize: true);
 }