so i have assigned the properties to a recipe at the start of program, but after the window ends, i cannot refer to this later, because the value of strawberryrecipe.type is now null. (EDIT: so all i had to do was remove "Recipe" in Recipe strawberryrecipe = new Recipe(); since i already put it as Recipe in class level i guess)
public partial class Production_Optimization_Window : Window
{
Ingredient strawberry;
Recipe strawberryrecipe;
public Production_Optimization_Window()
{
InitializeComponent();
Recipe strawberryrecipe = new Recipe();
strawberryrecipe.Type = "asd";
}
private void Button_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(strawberryrecipe.Type); //Here i get the error, and blueberry recipe.type = null.
}