Add cross-platform OPC UA client stack: shared library, CLI tool, and Avalonia UI
Implements Client.Shared (IOpcUaClientService with connection lifecycle, failover, browse, read/write, subscriptions, alarms, history, redundancy), Client.CLI (8 CliFx commands mirroring tools/opcuacli-dotnet), and Client.UI (Avalonia desktop app with tree browser, read/write, subscriptions, alarms, and history tabs). All three target .NET 10 and are covered by 249 unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
34
src/ZB.MOM.WW.LmxOpcUa.Client.UI/Views/MainWindow.axaml.cs
Normal file
34
src/ZB.MOM.WW.LmxOpcUa.Client.UI/Views/MainWindow.axaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using ZB.MOM.WW.LmxOpcUa.Client.UI.ViewModels;
|
||||
|
||||
namespace ZB.MOM.WW.LmxOpcUa.Client.UI.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs e)
|
||||
{
|
||||
base.OnLoaded(e);
|
||||
|
||||
// Wire up tree selection to the main ViewModel
|
||||
var browseTreeView = this.FindControl<BrowseTreeView>("BrowseTreePanel");
|
||||
var treeView = browseTreeView?.FindControl<TreeView>("BrowseTree");
|
||||
if (treeView != null)
|
||||
{
|
||||
treeView.SelectionChanged += OnTreeSelectionChanged;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTreeSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (DataContext is MainWindowViewModel vm && sender is TreeView treeView)
|
||||
{
|
||||
vm.SelectedTreeNode = treeView.SelectedItem as TreeNodeViewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user