Category - C#

  1. AppUrlHandlers

    The promise of web-to-app linking is that a developer can associate an app with a website. That way when you load the website the app will launch. Really cool!image_4

    However, the sad truth of the matter is that you have to do a Windows Key – R to Run the website. Normally I, and I assume most people, go to their browser to view websites. There’s simply no point in running the web page. It would be just as easy using a protocol like vudu: to launch the app from this Run dialog.

    There is a note in the blog post that reads: 


    I’m on the Fall Creators Update now and I’m not seeing this behavior. Was this a feature that was dropped? Could someone update the blog post?

    Getting to the point where all of this works was fairly simple. Add an extension to the app manifest. Then add a JSON file to the well-known folder on the website. Finally tweak the OnActivated method of the app to handle whatever URL comes our way. It’s all straight forward and spelled out in the documentation.

    I just don’t see the point of this when we have Protocol handlers already. What do you think?

  2. 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.