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); }