I've written a Windows 10 UWP in Visual Studio 2015 in C# that uses speech recognition to perform certain commands. All works great until the PC recovers from a display sleep or the app loses focus/is minimised. After that the app doesn't respond to the microphone unless i restart the app again. The app is designed only to be used on a couple of my Windows 10 Desktop PCs, so not concerned about mobile or other platform functionality. Is there any way of ensuring the app remains "connected" to the microphone or have I gone down a "blind alley" with UWP and should I have built it in WPF? I had assumed UWP was the future standard that MS was touting and that new apps should only be written in this format and not Forms, WCF or WPF. Am I wrong and is there still a future for WPF (if "yes" can I convert my UWP app to WPF in the hope that I can still have full access to thing like the microphone as I did in an older vb.net forms version of my app?).
So, to clarify, I need to know the following:
Any help would be very much appreciated, as I've spent a lot of time re-writing my old vb.net win forms app as a C# UWP app. Thanks, Richie
When a UWP app is minimised, it's suspend. There is no way to keep connected to a microphone. For more info, you can check Windows 10 universal Windows platform (UWP) app lifecycle.
Since you only need the app to work on Windows 10 Desktop PCs, then one of the best options would be using WPF, WPF can also work on Windows 10 and would continue to be supported. For example, they've added per-monitor DPI-awareness support for WPF (see https://github.com/Microsoft/WPF-Samples/tree/master/PerMonitorDPI). And a lot of UWP APIs can be used in WPF, you should be able to convert your UWP app to WPF manually. For more information, see this answer.