App.Current.Properties[“some”]和Application.Current.Productie

本文关键字:Current Productie Application some Properties App | 更新日期: 2023-09-27 18:29:11

这两个类(应用程序和应用程序)之间有什么不同。我制作了WPF应用程序,在使用应用程序和应用程序类的地方需要小心吗。现在我使用App.Current.Properties["property"] = property;,但在使用Application.Current.Properties["property"] = property;之前。这两种情况都在起作用。有什么不同吗。

App.Current.Properties[“some”]和Application.Current.Productie

这是一样的。App是这样声明的

class App : Application

所以它继承了(如果我可以这么说的话)所有静态属性(包括Current属性)。