开发者

data exchange of two windows WPF

开发者 https://www.devze.com 2023-04-12 23:55 出处:网络
I´m actually programming a WPF-application. Now, I´m just a beginner in WPF and so I´ve a problem:

I´m actually programming a WPF-application. Now, I´m just a beginner in WPF and so I´ve a problem:

In window A, there is a checkbox with some values. If I click on a button on window A, window B should open. On window B, I have a textfield and a save-button. When I click on the button on window B and close it, the value of the textfield should be in the checkbox on window A.

Firs开发者_高级运维t, I programmed this with Windows Forms and there I solved it with BindingSource. This doesn´t work in WPF. How can I solve that?


Well, I would say that this nothign to do with WPF ot WindowsForms, as idea can be applied in both places. Just use a shared between different forms DataStructure that holds and information you need and changed from different forms. Just to give a simple idea:

public class DataStructure 
{
   //properties 
}

public Form1 : Form 
{
    public Form1(DataStructure ds) {}
}



public Form2 : Form 
{
    public Form2(DataStructure ds) {}
}


The PageFunction allows you to return a value.

http://msdn.microsoft.com/en-us/library/ms615540.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消