Spatacoli

Upgrading Apps to Windows 8.1 – Deprecated Methods

In upgrading NOOK from Windows 8 to Windows 8.1 there are four methods/properties that we were using that have been deprecated since Windows 8. Here they are and the replacement:

1) ScrollViewer.ScrollToVerticalOffset and ScrollViewer.ScrollToHorizontalOffset have been replaced with ScrollViewer.ChangeView(OffsetX, OffsetY, ZoomLevel)

2) ApplicationView.View has been replaced with ApplicationView.GetForCurrentView().Orientation which is an ApplicationViewOrientation

3) DisplayProperties.LogicalDpi has been replaced with DisplayInformation.GetForCurrentView().LogicalDpi

The first one has a catch though. Previously if the horizontal scroll width was smaller than the requested position it would fail silently. Using ChangeView though it will throw an exception. What I’ve had to do in this case is wait until the GridView is loaded then I use an anonymous method to do the horizontal scroll.

The second one also has some interesting properties to it. Previously we were interested in if we were in snap view, but snap view is no longer used in Windows 8.1 so you need to stop looking for it. We use the Orientation to detect portrait versus landscape only. Width of the screen is detected with a size changed event.

Let me know if you have any more methods that are deprecated that are useful to know.