有没有在C#应用
和应用程序
之间有什么区别?
Is there any difference between App
and Application
in c#?
我想使用 App.current.Resources
,其中在主 WPF
应用程序加载控件库。但它是不可能在一条笔直的路,但在同一时间,它是允许我使用 Application.current.Resources
I am trying to use App.current.Resources
in control library which is loaded in main WPF
application. But it is not possible in a straight way, but at the same time it is allowing me to use Application.current.Resources
谁能帮我理解这两者之间的基本区别。
有没有使用任何瑕疵 Application.Current.Resources
而不是 App.current.Resources
?
Could anyone help me to understand the basic differences between these two.
Is there any flaw on using Application.Current.Resources
instead of App.current.Resources
?
应用
是你应用程序默认的类名
。它会在您的项目通过自动生成的code如下定义。
App
is the default class name for your Application
. It will be defined in your project by autogenerated code as follows.
public partial class App : Application
因此,我们确实都是一样的,你所访问的定义的静态
类只。当前
属性Application
So indeed both are same, You're accessing static Current
property defined in Application
class only.
Application.Current.Resources//Accessing current through base class
App.Current.Resources//Accessing current through derived class
上一篇:Android版PDF阅读器库阅读器、Android、PDF
下一篇:通过听的BroadcastReceiver来电,而不PhoneStateIntentReceiver或PhoneStateListener而不、BroadcastReceiver、PhoneState