I am really struggling here being a newbie programmer... This has all been done in WPF by the way
I have three textboxes in my MainWindow.
The method which returns the values to these textboxes has been made public (and is within MainWindow). Below is one of the three textboxes.
public float GetLEL()
{
bool LEL = false;
float parsedLELValue = 0;
LEL = float.TryParse(LEL_TextBox.Text, out parsedLELValue);
return parsedLELValue;
}
How can I return this value into my usercontrol class as is, even if it changes?
I have tried all sorts such as creating an instance within the Usercontrol (which haven't worked) -
Application app = new Application();
private float GetNewLEL()
{
float parsedNewLELValue = 0.00F;
bool NewLEL = false;
if (HolidayPay_CheckBox.IsChecked == false)
{
NewLEL = float.TryParse(app.GetHPR().ToString, out parsedNewLELValue);
}
else if (HolidayPay_CheckBox.IsChecked == true)
{
parsedNewLELValue = 0.00F;
}
return parsedNewLELValue;
}
However, the instance in the Usercontrol is not finding the GetLEL() Method from within the MainWindow. Can someone please help. Someone else has suggested Get and Set but I am not sure of how to do this.