优化项目代码

This commit is contained in:
2026-04-22 14:45:50 +08:00
parent 4f00c84639
commit ae94957917
16 changed files with 42 additions and 36 deletions

View File

@@ -27,15 +27,23 @@ namespace 头罩视野
InitializeComponent();
ModbusHelper.Connect("192.168.1.10", 502); // 连接一次,全局生效
}
//private void GoHome(object s, RoutedEventArgs e) => MainFrame.Content = new Views.ChangeLanguage();
private void GoTest(object s, RoutedEventArgs e) => MainFrame.Content = new Views.PageTest();
// 程序退出
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
//ModbusHelper.Dispose();
}
//private void GoTest(object s, RoutedEventArgs e) => MainFrame.Content = new Views.PageTest();
private void GoRecord(object s, RoutedEventArgs e) => MainFrame.Content = new Views.RecordDate();
private void GoView(object s, RoutedEventArgs e) => MainFrame.Content = new Views.RecordPage();
//private void GoView(object s, RoutedEventArgs e) => MainFrame.Content = new Views.RecordPage();
private void GoVisiPage(object s, RoutedEventArgs e) => MainFrame.Content = new Views.VisiData();
//NavigationService.Navigate(new Views.RecordDate()); 页面相互跳转
private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
//private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
}
}