从App.cs调用MainPage.cs中的函数 [英] Calling a function in MainPage.cs from App.cs

查看:111
本文介绍了从App.cs调用MainPage.cs中的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

是否可以从app.cs调用Mainpage.xaml.cs中的函数?

Is it at all possible to call a function in Mainpage.xaml.cs from app.cs?

感谢Nathan

推荐答案

MainPage是类名,因此您应该能够在类中调用该函数。  如果它与ui交互,确保你正在调用该类的可见实例。
MainPage is the class name so you should be able to call the function in the class.  If it does something that interacts with ui make sure you are calling the visible instance of the class.


这篇关于从App.cs调用MainPage.cs中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆