Ejemplo n.º 1
0
 public static void ShowWindow()
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title           = "管理本机 IP",
         IconName        = "Icon_Ip",
         Width           = 450,
         IsMaskTheParent = true,
         FooterVisible   = Visibility.Collapsed,
         CloseVisible    = Visibility.Visible
     }, ucFactory: (window) => {
         var uc = new LocalIpConfig();
         window.AddOnecePath <CloseWindowCommand>("处理关闭窗口命令", LogEnum.DevConsole, action: message => {
             window.Close();
         }, pathId: uc.Vm.Id, location: typeof(LocalIpConfig));
         uc.ItemsControl.MouseDown += (object sender, MouseButtonEventArgs e) => {
             if (e.LeftButton == MouseButtonState.Pressed)
             {
                 window.DragMove();
             }
         };
         window.AddEventPath <LocalIpSetInitedEvent>("本机IP集刷新后刷新IP设置页", LogEnum.DevConsole,
                                                     action: message => {
             UIThread.Execute(() => uc.Vm.Refresh());
         }, location: typeof(LocalIpConfig));
         return(uc);
     }, fixedSize: true);
 }
Ejemplo n.º 2
0
 public static void ShowWindow()
 {
     ContainerWindow.ShowWindow(new ContainerWindowViewModel {
         Title          = "管理本机 IP",
         IconName       = "Icon_Ip",
         Width          = 450,
         IsDialogWindow = true,
         FooterVisible  = Visibility.Collapsed,
         CloseVisible   = Visibility.Visible
     }, ucFactory: (window) => {
         var uc = new LocalIpConfig();
         LocalIpConfigViewModel vm  = (LocalIpConfigViewModel)uc.DataContext;
         vm.CloseWindow             = window.Close;
         uc.ItemsControl.MouseDown += (object sender, MouseButtonEventArgs e) => {
             if (e.LeftButton == MouseButtonState.Pressed)
             {
                 window.DragMove();
             }
         };
         window.WindowContextEventPath <LocalIpSetRefreshedEvent>("本机IP集刷新后刷新IP设置页", LogEnum.DevConsole,
                                                                  action: message => {
             UIThread.Execute(() => vm.Refresh());
         });
         return(uc);
     }, fixedSize: true);
 }