本文介绍了我如何委派一个函数以在WPF中打开窗口对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我是WPF的新手. (Window Presentation Foundation.)
我想委托一个函数来控制打开窗口Dialog.在窗口上我委托了一个函数来在Window Form中打开表单.

Dear all,

I am a newbie in WPF. (Window Presentation Foundation.)
I want to delegate a function to control the opening window Dialog . on the Window From I had delegated a function to open form in Window Form.

public delegate System.Windows.Forms.DialogResult OpenObjectFunction(string strAssemblyName, string strClassName, bool bIsModal, object objParamIn, out object objParamOut);


所以,现在我想开发WPF.我想在Window Form中构建相同的功能.

请帮助我,如果您有任何理想的话.

谢谢.


So, Now i want to develop WPF. And I want to build a function the same in Window Form.

Please help me, If you have any ideal.

Thank you.

推荐答案

public delegate System.Windows.Forms.DialogResult OpenObjectFunction(string strAssemblyName, string strClassName, bool bIsModal, object objParamIn, out object objParamOut);



引用这样的方法:




that references a method like this :


public virtual System.Windows.Forms.DialogResult OpenObject(string strAssemblyName, string strClassName, bool bIsModal, object objParamIn, out object objParamOut)



在这种方法下,我可以做一些代码来控制我的过程,然后再打开一个新窗口对话框.
我可以创建一个属性



on this method I can do something code to control my process before open a new window dialogbox.
and I can create a property

public OpenObjectFunction OpenObject {get;set}



因此,我需要像在WPF中一样进行操作.并且不支持WPF枚举DialogResult.

抱歉,我试图解释我的想法.但是我的语言不好.



So I need t o do same like that in WPF. and WPF is not supported enum DialogResult.

Sorry, I tried to explain my idea. But my language is not good.


这篇关于我如何委派一个函数以在WPF中打开窗口对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 17:40