Return an object from a popup window

前端 未结 6 495
面向向阳花
面向向阳花 2020-12-24 12:23

I have a Window which pop-ups another Window. I want the second Window to be able to return an object to the first Window when a button is pressed. How would I do this?

6条回答
  •  误落风尘
    2020-12-24 12:47

    You can simply call any method of the popup window like this:

    int value = 0;
    if ((bool)poupWindow.ShowDialog() == true) {
      value = poupWindow.GetValue();
    }
    

提交回复
热议问题