I've searched forum for similar issues and as I understand, global variables is to be avoided. For me that is not logical yet, as I'm new to programming. If I've understood all this correctly, a static variable should do the job that I'm looking for.
I've made a combobox of four choices in the mainwindow and when a comboboxitem is selected, variable b is declared. This is done in a private void SelectionChanged.
When the comboboxitem declaring variable b is selected, a usercontrol pops up. I want to use variable b further in my program, but I can't access it. I've tried to declare static int b;
in the beginning of the code, but I'm not sure if I understand the use of a static variable correctly. Can someone please help me?