Hi everyone. I am trying to fill class with data and use these data anywhere else on the program, where i Will need it.
I created this class
- public class id
- {
- private string name;
- public string Name
- {
- get { return name; }
- set { name = value; }
- }
- }
And in form_name i tried to fill the class on this way:
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- id IDOBJE = new id();
- {
- IDOBJE.Name = txtshenimi.Text;
- }
- this.Close();
- }
- }
And in another form i tried to retrieve data like this:
- private void Button_Click_1(object sender, RoutedEventArgs e)
- {
- id idobje = new id();
- txtrez.Text = idobje.Name;
- }
But I don't get any result. Could someone help me to clarify this, cause i am new to OOP, and don't know so much about classes, and objects.