|
|
@@ -5,29 +5,27 @@ using System.Windows.Input;
|
|
|
|
|
|
namespace NTMiner.MinerStudio.Views.Ucs {
|
|
|
public partial class GpuNames : UserControl {
|
|
|
- public GpuNamesViewModel Vm { get; private set; }
|
|
|
-
|
|
|
public GpuNames() {
|
|
|
if (WpfUtil.IsInDesignMode) {
|
|
|
return;
|
|
|
}
|
|
|
- this.Vm = new GpuNamesViewModel();
|
|
|
- this.DataContext = this.Vm;
|
|
|
InitializeComponent();
|
|
|
this.OnLoaded(onLoad: window => {
|
|
|
window.AddEventPath<GpuNameAddedEvent>("添加了显卡特征名后刷新显卡特征名列表", LogEnum.DevConsole, action: message => {
|
|
|
- this.Vm.Query();
|
|
|
+ UIThread.Execute(() => {
|
|
|
+ ((GpuNamesViewModel)this.DataContext).Query();
|
|
|
+ });
|
|
|
}, typeof(GpuNames));
|
|
|
});
|
|
|
}
|
|
|
|
|
|
private void TbKeyword_LostFocus(object sender, RoutedEventArgs e) {
|
|
|
- Vm.Search.Execute(null);
|
|
|
+ ((GpuNamesViewModel)this.DataContext).Search.Execute(null);
|
|
|
}
|
|
|
|
|
|
private void TbKeyword_KeyUp(object sender, KeyEventArgs e) {
|
|
|
if (e.Key == Key.Enter) {
|
|
|
- Vm.Keyword = this.TbKeyword.Text;
|
|
|
+ ((GpuNamesViewModel)this.DataContext).Keyword = this.TbKeyword.Text;
|
|
|
}
|
|
|
}
|
|
|
}
|