Hello,
you are right that there currently isn't any example that shows this, but it is easy to achieve.
The dialogs are Windows Forms components. They can be used from WPF, but WPF does not support non-visual components which represent the dialogs, therefore the dialog objects need to be instantiated and set up from the code. I have created this example now.
If the user wants to re-create it, he/she needs to reference the System.Windows.Forms, and BaseLib, BaseLibForms, and EasyOpcForms assemblies, and the assembly for the particular OPC technology (EasyOpcClassic or EasyOpcUA), in the WPF project. Then, the dialog can be invoked as in the code below; in my case, I have put the invocation code into the event handler on a button click.
using System.Windows;
using OpcLabs.EasyOpc.UA.Forms.Browsing;
namespace UAWpfRunDialog
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var dataDialog = new UADataDialog
{
EndpointDescriptor = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
};
if (dataDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
return;
NodeIdTextBlock.Text = dataDialog.NodeDescriptor.NodeId.ToString();
}
}
}
I hope this helps