I have created a class which passes a string parameter in the constructor. I change the value of the parameter in the constructor. When the control is back on my original class, the value is not changed. I expect it to change - please help
string NewNodeName = "";
AddNode NewNodeFrm = new AddNode( NewNodeName);
NewNodeFrm.ShowDialog();
if (NewNodeFrm.DialogResult.Equals(true))
{
MessageBox.Show(NewNodeName);
}
In class called
public partial class AddNode : Window
{
private string NodeName;
public AddNode(ref string ANodeName)
{
NodeName = ANodeName;
NodeName = "Fred";
InitializeComponent();
}