Say, if I have my own data class defined as such:

```
public class MyData
{
    public string v1;
    public int v2;
    //etc.
}

```

I can pass it to my own Form-derived class and use it to initialize the form controls:

```
public partial class MyForm : Form
{
    private MyData dataIn;

    public MyForm(MyData data)
    {
        InitializeComponent();

        dataIn = data;
    }
}

private void MyForm_Load(object sender, EventArgs e)
{
    //Init controls in 'MyForm' from 'dataIn'
}

private void buttonSave_Click(object sender, EventArgs e)
{
    //Save button was clicked

    //Read data from 'MyForm', but
    //how to return it back in 'MyData' class?

    //Close form
    this.DialogResult = System.Windows.Forms.DialogResult.OK;
    this.Close();
}

```

And the form itself is called as such:

```
//Initial data for the form
MyData data = new MyData(){
    v1 = "test",
    v2 = 123
};

MyForm dlg = new MyForm(data);
if (dlg.ShowDialog() == DialogResult.OK)
{
    //User clicked Save -- how to get data back in 'MyData'?
}

```

The issue is how to have my `MyData` to be filled with data and returned from `MyForm`?