コード例 #1
0
ファイル: CalcConfig.xaml.cs プロジェクト: TimeYM/ntminer
 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
ファイル: CalcConfig.xaml.cs プロジェクト: suifengtec/NtMiner
 private CalcConfig()
 {
     if (WpfUtil.IsInDesignMode)
     {
         return;
     }
     this.Vm          = new CalcConfigViewModels();
     this.DataContext = this.Vm;
     InitializeComponent();
     this.OnLoaded((window) => {
         window.BuildEventPath <CalcConfigSetInitedEvent>("收益计算器数据集刷新后刷新VM", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal,
                                                          path: message => {
             Vm.Refresh();
         });
     });
 }
コード例 #3
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);
 }