Hi all,
I’m trying to create note, that opens a new window with user interface. I have achieved the desired result, but the node has an input parameter, that I didn’t set. I just started learning C#. Tell me please, is it possible to get rid of unnecessary input parameters?
Code for window with user interface
using System.Windows;
namespace TestNodes
{
/// <summary>
/// TestUI.xaml
/// </summary>
public partial class TestUI : Window
{
public TestUI()
{
InitializeComponent();
}
private void ok_buttom_Click(object sender, RoutedEventArgs e)
{
DialogResult = true;
}
private void cencel_buttom_Click(object sender, RoutedEventArgs e)
{
DialogResult=false;
Close();
}
}
Code of the method, that launches the window with the user interface.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestNodes
{
public class UserInterface
{
public List<Object> UI_Interface()
{
List<Object> ListReturn = new List<Object>();
TestUI window = new TestUI();
var res = window.ShowDialog();
if (!res.HasValue && res.Value)
window.Close();
ListReturn.Add(window.textbox.Text);
return ListReturn;
}
}
}
This node in Dynamo.
I have studied a lot of information and have not found a way to get rid of this parameter, please help me.