What is the difference between application and application in C # .net?

Is there any difference between App and Application in C #?

I am trying to use App.current.Resources in a management library that loads into the main WPF application. But this is not possible in a direct form, but at the same time it allows me to use Application.current.Resources

Can someone help me understand the main differences between the two. Is there a drawback to using Application.current.Resources instead of App.current.Resources ?

+7
c # wpf
source share
1 answer

App is the default class name for your Application . It will be defined in your project using auto-generated code as follows.

 public partial class App : Application 

Indeed, both of them are the same, you get access to the static property Current , which is defined only in the Application class.

 Application.Current.Resources//Accessing current through base class App.Current.Resources//Accessing current through derived class 
+10
source share

All Articles