A control with various OPC-UA nodes from which the user can select. This control can be configured to serve many different purposes.
General
The generic OPC UA browsing control is represented by the UABrowseControl Class (in Windows Forms) or by the WpfUABrowseControl Class (in WPF).
With it, your forms can integrate a control with various OPC nodes from which the user can select. This control can be configured to serve many different purposes.
Here is an example of the generic OPC browsing control in action:
The functionality and properties of the UABrowseControl or WpfUABrowseControl are similar to that of UABrowseDialog, described earlier in this text. Please refer to the documentation of UABrowseDialog for details. Here are the major differences:
- There is no toolbar, no filter controls, no node information box, no error box, and no status bar. Events are provided (described further below) that allow you to implement similar functionality yourself, if needed.
- Changes you make in run-time to relevant values of the Inputs and InputsOutputs properties are immediately reflected in the control. Analogically, actions by the user that change the current node or the selection set are immediately projected into the InputsOutputs and Outputs properties.
- When multi-selection mode is enabled, the nodes are always selected directly in the list view, and not in a separate list. For this reason, the nodes in a multi-selection must all belong under a single parent branch.
- If only a tree view is displayed, the tree will also contain the leaves.
- If only a list view is displayed, the list will also always contain the branches, regardless of the Mode.ShowListBranches property value.
- When a node is selected in the tree view, a first node in the list view is not automatically focused.
- In the design-time mode, the control always shows simulated data, even if the Simulated property is set to false.
Using the Kind property, the browsing control can be configured to provide a tree view only (BrowseControlKinds.Tree), a list view only (BrowseControlKinds.List), or a combined tree view and list view (BrowseControlKinds.TreeAndList; this is the default).
The View property (of System.Windows.Forms.View enumeration type) controls how the list view items are displayed. Possible values are LargeIcon, Details (the default), SmallIcon, List, or Tile.
In order to achieve tight integration with other controls on your form, you can hook to events that the browsing control provides.
The CurrentNodeChanged event occurs when the current node changes. You can obtain the information about the new current node from InputsOutputs.CurrentNodeDescriptor and Outputs.CurrentNodeElement properties inside the event handler.
The SelectionChanged event is meant for multi-selection mode, and occurs when the selection set changes. You can obtain the information about the new selection set from InputsOutputs.SelectionDescriptors and Outputs.SelectionElements collections inside the event handler.
The NodeDoubleClick event occurs when a node is double-clicked. This is the current node, and therefore the information about it can be obtained in the same way as in the CurrentNodeChanged event handler, described above.
The BrowseFailure event indicates that an exception has occurred during browsing. The information about the exception is contained in the event arguments.
Windows Forms
In Windows Forms, the generic OPC UA browsing control is represented by the UABrowseControl Class, which is implemented directly in the Windows Forms technology. There is also a corresponding icon in the Visual Studio Toolbox that you drag onto a design surface of your forms or user control.
WPF
In WPF (Windows Presentation Foundation), the generic OPC UA browsing control is represented by the WpfUABrowseControl Class, which is implemented as a WPF wrapper around the Windows Forms control (UABrowseControl). There is also a corresponding icon in the Visual Studio Toolbox that you drag onto a design surface of your window.
Example
Advanced
If you want to change the parameters of the client objects the component uses to perform its OPC operations, you can use the ClientSelector Property.