using CommunityToolkit.Mvvm.ComponentModel;
|
using NationalInstruments.TestStand.Interop.API;
|
using NationalInstruments.TestStand.Interop.UI.Ax;
|
using System.Windows;
|
using System.Windows.Forms.Integration;
|
|
namespace StationGlobalsReader;
|
|
/// <summary>
|
/// Interaction logic for MainWindow.xaml
|
/// </summary>
|
[ObservableObject]
|
public partial class MainWindow : Window
|
{
|
public MainWindow()
|
{
|
axApplicationMgr = new AxApplicationMgr();
|
InitializeComponent();
|
|
this.engine = axApplicationMgr.GetEngine();
|
this.engine.PersistBreakpoints = false;
|
this.axApplicationMgr.IsEditor = true;
|
this.axApplicationMgr.LoginOnStart = false;
|
this.axApplicationMgr.Start();
|
((System.ComponentModel.ISupportInitialize)(axApplicationMgr)).BeginInit();
|
host.Child = axApplicationMgr;
|
((System.ComponentModel.ISupportInitialize)(axApplicationMgr)).EndInit();
|
}
|
private AxApplicationMgr axApplicationMgr;
|
|
private Engine engine = null;
|
|
[ObservableProperty]
|
private string propertyName;
|
|
[ObservableProperty]
|
private string target;
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
{
|
try
|
{
|
Target = engine.Globals.GetValString($"StationGlobals.{PropertyName}", 0);
|
}
|
catch (Exception ex)
|
{
|
MessageBox.Show(ex.Message);
|
}
|
}
|
}
|