public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm) { InitializeComponent(); if (selectedKernelOutputVm != null) { Vm.CurrentKernelOutputVm = selectedKernelOutputVm; } }
public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm) { if (selectedKernelOutputVm != null) { KernelOutputPageViewModel.Current.CurrentKernelOutputVm = selectedKernelOutputVm; } InitializeComponent(); ResourceDictionarySet.Instance.FillResourceDic(this, this.Resources); }
public static void ShowWindow(KernelOutputViewModel selectedKernelOutputVm) { ContainerWindow.ShowWindow(new ContainerWindowViewModel { IconName = "Icon_KernelOutput", CloseVisible = System.Windows.Visibility.Visible, FooterVisible = System.Windows.Visibility.Collapsed, Width = 960, Height = 720 }, ucFactory: (window) => new KernelOutputPage(selectedKernelOutputVm)); }
private KernelOutputViewModels() { if (WpfUtil.IsInDesignMode) { return; } #if DEBUG NTStopwatch.Start(); #endif VirtualRoot.AddEventPath <ServerContextReInitedEvent>("ServerContext刷新后刷新VM内存", LogEnum.DevConsole, action: message => { _dicById.Clear(); Init(); }, location: this.GetType()); VirtualRoot.AddEventPath <ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole, action: message => { AllPropertyChanged(); }, location: this.GetType()); AddEventPath <KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { var vm = new KernelOutputViewModel(message.Source); _dicById.Add(message.Source.GetId(), vm); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); }, location: this.GetType()); AddEventPath <KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { if (_dicById.TryGetValue(message.Source.GetId(), out KernelOutputViewModel vm)) { if (vm != null) { vm.Update(message.Source); } } }, location: this.GetType()); AddEventPath <KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { if (_dicById.ContainsKey(message.Source.GetId())) { _dicById.Remove(message.Source.GetId()); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); } }, location: this.GetType()); Init(); #if DEBUG var elapsedMilliseconds = NTStopwatch.Stop(); if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) { Write.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.ctor"); } #endif }
public static void ShowEditWindow(KernelOutputViewModel source) { ContainerWindow.ShowWindow(new ContainerWindowViewModel { IsDialogWindow = true, CloseVisible = System.Windows.Visibility.Visible, IconName = "Icon_KernelOutput" }, ucFactory: (window) => { KernelOutputViewModel vm = new KernelOutputViewModel(source); vm.CloseWindow = () => window.Close(); return(new KernelOutputEdit(vm)); }, fixedSize: true); }
public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm) { if (WpfUtil.IsInDesignMode) { return; } this.Vm = new KernelOutputPageViewModel(); this.DataContext = this.Vm; InitializeComponent(); if (selectedKernelOutputVm != null) { Vm.CurrentKernelOutputVm = selectedKernelOutputVm; } }
public static void ShowWindow(FormType formType, KernelOutputViewModel source) { ContainerWindow.ShowWindow(new ContainerWindowViewModel { Title = "内核输出", FormType = formType, IsMaskTheParent = true, Width = 900, CloseVisible = System.Windows.Visibility.Visible, IconName = "Icon_KernelOutput" }, ucFactory: (window) => { KernelOutputViewModel vm = new KernelOutputViewModel(source); window.AddCloseWindowOnecePath(vm.Id); return(new KernelOutputEdit(vm)); }, fixedSize: true); }
private KernelOutputViewModels() { #if DEBUG Write.Stopwatch.Restart(); #endif VirtualRoot.On <ServerContextReInitedEvent>("ServerContext刷新后刷新VM内存", LogEnum.DevConsole, action: message => { _dicById.Clear(); Init(); }); VirtualRoot.On <ServerContextVmsReInitedEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole, action: message => { AllPropertyChanged(); }); On <KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { var vm = new KernelOutputViewModel(message.Source); _dicById.Add(message.Source.GetId(), vm); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); }); On <KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { if (_dicById.ContainsKey(message.Source.GetId())) { var item = _dicById[message.Source.GetId()]; if (item != null) { item.Update(message.Source); } } }); On <KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { if (_dicById.ContainsKey(message.Source.GetId())) { _dicById.Remove(message.Source.GetId()); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); } }); Init(); #if DEBUG Write.DevTimeSpan($"耗时{Write.Stopwatch.ElapsedMilliseconds}毫秒 {this.GetType().Name}.ctor"); #endif }
public static void ShowWindow(FormType formType, KernelOutputViewModel source) { ContainerWindow.ShowWindow(new ContainerWindowViewModel { Title = "内核输出", FormType = formType, IsDialogWindow = true, Width = 900, CloseVisible = System.Windows.Visibility.Visible, IconName = "Icon_KernelOutput" }, ucFactory: (window) => { KernelOutputViewModel vm = new KernelOutputViewModel(source) { CloseWindow = () => window.Close() }; return(new KernelOutputEdit(vm)); }, fixedSize: true); }
public static void ShowWindow(FormType formType, KernelOutputViewModel source) { ContainerWindow.ShowWindow(new ContainerWindowViewModel { Title = "内核输出", FormType = formType, IsMaskTheParent = true, Width = 900, CloseVisible = System.Windows.Visibility.Visible, IconName = "Icon_KernelOutput" }, ucFactory: (window) => { KernelOutputViewModel vm = new KernelOutputViewModel(source); window.AddOnecePath <CloseWindowCommand>("处理关闭窗口命令", LogEnum.DevConsole, action: message => { window.Close(); }, pathId: vm.Id, location: typeof(KernelOutputEdit)); return(new KernelOutputEdit(vm)); }, fixedSize: true); }
private KernelOutputViewModels() { if (WpfUtil.IsInDesignMode) { return; } VirtualRoot.AddEventPath <ServerContextReInitedEvent>("ServerContext刷新后刷新VM内存", LogEnum.DevConsole, action: message => { _dicById.Clear(); Init(); }, location: this.GetType()); VirtualRoot.AddEventPath <ServerContextReInitedEventHandledEvent>("ServerContext的VM集刷新后刷新视图界面", LogEnum.DevConsole, action: message => { AllPropertyChanged(); }, location: this.GetType()); AddEventPath <KernelOutputAddedEvent>("添加了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { var vm = new KernelOutputViewModel(message.Source); _dicById.Add(message.Source.GetId(), vm); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); }, location: this.GetType()); AddEventPath <KernelOutputUpdatedEvent>("更新了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { if (_dicById.TryGetValue(message.Source.GetId(), out KernelOutputViewModel vm)) { if (vm != null) { vm.Update(message.Source); } } }, location: this.GetType()); AddEventPath <KernelOutputRemovedEvent>("移除了内核输出组后刷新VM内存", LogEnum.DevConsole, action: message => { if (_dicById.ContainsKey(message.Source.GetId())) { _dicById.Remove(message.Source.GetId()); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); } }, location: this.GetType()); Init(); }
public KernelOutputPage(KernelOutputViewModel selectedKernelOutputVm) { if (WpfUtil.IsInDesignMode) { return; } this.Vm = new KernelOutputPageViewModel(); this.DataContext = this.Vm; InitializeComponent(); this.OnLoaded(window => { window.BuildEventPath <KernelOutputKeywordLoadedEvent>("刷新Vm内存", LogEnum.None, this.GetType(), PathPriority.BelowNormal, message => { this.Vm.CurrentKernelOutputVm?.OnPropertyChanged(nameof(KernelOutputViewModel.KernelOutputKeywords)); }); }); if (selectedKernelOutputVm != null) { Vm.CurrentKernelOutputVm = selectedKernelOutputVm; } }
private KernelOutputViewModels() { if (WpfUtil.IsInDesignMode) { return; } VirtualRoot.BuildEventPath <ServerContextReInitedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal, path: message => { _dicById.Clear(); Init(); }); VirtualRoot.BuildEventPath <ServerContextReInitedEvent>("刷新视图界面", LogEnum.DevConsole, location: this.GetType(), PathPriority.BelowNormal, path: message => { AllPropertyChanged(); }); BuildEventPath <KernelOutputAddedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal, path: message => { var vm = new KernelOutputViewModel(message.Source); _dicById.Add(message.Source.GetId(), vm); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); }); BuildEventPath <KernelOutputUpdatedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal, path: message => { if (_dicById.TryGetValue(message.Source.GetId(), out KernelOutputViewModel vm)) { if (vm != null) { vm.Update(message.Source); } } }); BuildEventPath <KernelOutputRemovedEvent>("刷新VM内存", LogEnum.DevConsole, location: this.GetType(), PathPriority.Normal, path: message => { if (_dicById.ContainsKey(message.Source.GetId())) { _dicById.Remove(message.Source.GetId()); OnPropertyChanged(nameof(AllKernelOutputVms)); OnPropertyChanged(nameof(PleaseSelectVms)); } }); Init(); }
public KernelOutputEditCommand(FormType formType, KernelOutputViewModel source) { this.FormType = formType; this.Source = source; }
public ShowKernelOutputPageCommand(KernelOutputViewModel selectedKernelOutputVm) { this.SelectedKernelOutputVm = selectedKernelOutputVm; }
public bool TryGetKernelOutputVm(Guid id, out KernelOutputViewModel kernelOutputVm) { return(_dicById.TryGetValue(id, out kernelOutputVm)); }
public KernelOutputEdit(KernelOutputViewModel vm) { this.DataContext = vm; InitializeComponent(); ResourceDictionarySet.Instance.FillResourceDic(this, this.Resources); }
public KernelOutputEdit(KernelOutputViewModel vm) { this.DataContext = vm; InitializeComponent(); }