Original: Win10 UWP Development Series: Resolving compatibility issues caused by different versions of style differences WIN10
Recently in the development of a project, encountered a strange problem, the project depends on the minimum version is 10586, the target version is 14393, after the development is published to the store, many users reported unable to load the page normally. After the investigation, the problem is Win10 10586 version.
The custom AppBar control I wrote in my last blog post also has this problem, and 10586 will report an error.
10586 of the SDK debugs have been downloaded for this purpose. The error shows that a style cannot be found, named Listviewitembackground. Since the development is based on 14393, it is possible that the 14393 SDK has this style by default, but 10586 does not.
The following directories are found first:
C:\Program Files (x86) \ Windows KITS\10\DESIGNTIME\COMMONCONFIGURATION\NEUTRAL\UAP
You can see the following three directories:
This is the three different versions of WIN10. Open the inside of the generic directory, in turn, the GENERIC.XAML is the default style file. To compare the differences between the three versions, students using VS code can install this plugin:
After the installation, reload, three versions of the Generic.xaml dragged in, the first to compare the file right-click on the select Mark 1st files, on the second file right-click on the selection of Mark 2nd file, you can compare.
First find Listviewitembackground This value, found that 14393 in the property has this attribute, but 10586 no, can not find the value of the error:
You can see that the difference is still relatively large.
As for the custom AppBar problem, it's because I copied the template from the 14393 style:
In 10586, AppBar's template is this:
But in 14393, it's actually the same value as 10586:
In other words, some resources were re-named in 14393. The legendary Microsoft renaming department is again meritorious.
Comparing 14393 and 15063, you can see that there are also some minor changes:
So if you want to use these styles, make sure that the default styles in different versions exist, otherwise you will not find the resources to error.
So how do you solve this problem? One scenario is to copy the part of the default style of 14393 that does not exist in 10586 to the project. However, if you use custom controls, you may still find inexplicable errors, such as the templates of some controls that use only 14393 of the attributes that are supported, and you can refer to these articles:
Http://stackoverflow.com/questions/40397909/templatebinding-used-after-must-be-a-markup-extension-error-on-uwp-gridvi
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/af308462-59b3-4ec6-9640-f0a3c5956004/ Uwptemplatebinding-used-after-must-be-a-markup-extension-error-on-uwp-gridview?forum=wpdevelop
So on the safe side, the minimum version of the project is changed to 14393. It is important to note that the 15063 style is still changed, and you need to consider compatibility if you customize the template.
WIN10 UWP Development Series: Resolve compatibility issues caused by different style differences in WIN10 versions