简体   繁体   中英

UWP vs WPF: System.Globalization CultureInfo is different?

Setup:

  • VS2015 C# solution
  • Contains one UWP project
  • Contains one WPF project
  • Both projects declare var ci = new CultureInfo(1)

Question(s):

  • Why does the WPF project find the constructor taking an int, but the UWP project does not ?
  • Why does browsing the System.Globalization namespace on msdn state that it should be there, if it's not there for UWP?
  • How can we browse the MSDN APIs that are relevant to a particular target type/profile?

Yes, basically some members are available on some platforms but not others. Look at the version information for CultureInfo(int) constructor vs CultureInfo.DateTimeFormat in the Version Information section, as an example.

Constructor Version Information:

.NET Framework
Available since 1.1

DateTimeFormat Version Information:

Universal Windows Platform
Available since 4.5
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1

Note the lack of mention of UWP on the constructor docs...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM