High DPI scaling in Windows 10, 8, 8.1, and 7? - winforms

Which is the simplest way to make my application DPI-aware for Windows 10 Creator's edition, Windows 7, 8, and 8.1? I see a lot of different options to add to the app.config and app.manifest and am just confused on which to add for my case. Was high-dpi even supported before Windows 10 Creator's Update??
I am developing Winforms using Visual Studio 2017 and we can not move to WPF. I have read this article but am still confused.
I'm thinking of adding
<compatibility xmlns="urn:schemas-microsoft.comn:compatibility.v1">
<application>
<!-- Windows 10 compatibility -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
to the manifest and
<System.Windows.Forms.ApplicationConfigurationSection>
<add key="DpiAwareness" value="PerMonitorV2" />
</System.Windows.Forms.ApplicationConfigurationSection>
to the app.config for the Windows 10 but then I need it to fall back for Windows 8, 8.1 and 7.

Related

Silverlight vs W8/W8.1/WP8/WP8.1

I know you can develop W8 apps using c# and XAML. Is it the same on wp8 ?
How does Silverlight relate to all of this and how does WP8.1/WP8 relate to all of this.
Please tell me if you want more specifics.
You can develop apps on Windows Phone using C# and XAML.
Windows 8 uses a runtime called WinRT. Windows Phone traditionally uses a runtime called Silverlight. Both are on based on C# and XAML, but they have different controls and different classes.
Starting with Windows Phone 8.1, you can make phone apps using WinRT. So you can now write apps for both Windows 8 and Windows Phone 8.1 using the same runtime (and therefore share large portions of the code): they are called "Universal Apps".
As to know which one you should use:
If you want to make an app for both Windows 8 and Windows Phone then it's a no-brainer: create an universal app
If you want to make an app that will run only on Windows Phone, then I would personally recommand using WinRT since that's the "future-proof" choice. However, some Windows Phone APIs aren't supported yet by the WinRT runtime. If you need one of those APIs, then you have no choice but using Silverlight.
http://blogs.msdn.com/b/eob/archive/2014/04/16/starting-with-universal-apps-on-visual-studio-2013.aspx
On this version we have a API convergence of 90%, still there is a small set not converget yet, that are Phone features only available in Silverlight such:
Lenses Support
VOIP Suport
Camera Capture Task
Clipboard APIs
Lock Screen Wallpaper API
1 Ans: You can develop Windows 8, Windows 8.1, Windows Phone 7, Windows Phone 8 & Windows Phone 8.1 applications using C# & XAML.
2: Ans: Windows Phone 7, Windows Phone 8 & Windows Phone 8.1 (Targetting Silverlight) uses Silverlight API's. And how Windows Phone 8 & Windows Phone 8.1 relate to Silverlight, well they use the SIlverlight API's that are available for mobile application framework.
Windows 8 & Windows 8.1 both target WinRT API's. Currently Windows Phone 8.1 also support WinRT API's. So, if you want to create Windows 8.1 & Windows Phone 8.1 applications that you can do by creating a Universal application targeting both the platforms (They have convergence of 90%).
If you want to create Windows 8 & Windows Phone 8 applications, you will require Visual Studio 2012 & Windows 8 OS.
If you want to create Windows 8.1, Windows Phone 8 & Windows Phone 8.1 applications , you require Visual Studio 2013 & Windows 8.1 OS.
This Link gives you a brief idea about Windows 8 & Windows Phone 8 app development.
Hope this helps.

Is Silverlight supported on Windows 8?

Can existing apps (both web and desktop apps) using Silverlight run on Windows 8? How about Windows RT?
If it's not possible, what would be the path of least resistance to make it work? (Viz., how to get it working on Windows 8/RT, not caring about whether it'll work on Windows 9 or not.)
Existing Silverlight applications can run in the Windows 8 Desktop, but cannot run as part of a Windows Store application. Only Windows Store applications can run on Windows RT (with exception of Office apps delivered by Microsoft).
Path of least resistance would be leveraging your assets - it's C#/VB and XAML still - within the Windows RT framework.
You might check out this Deep Fried Bytes episode, and there are other blog posts as well to give you some guidance. There's also an article on the Dev Center focused on Windows Phone 7 Silverlight to Windows 8, but much should be application to your scenario as well.
You WPF and Silverlight application work fine on Windows 8, but not in the Windows store, which needs only Metro Applications.
But you can more and less easily port your Silverlight app to Metro : you keep XAML files, and you change the code behind with new objects defined ine the Windows 8 libraries.

Confused about windows gadget

I have developed a Windows desktop gadget using Silverlight (MVVM pattern) and WCF.
I want to know whether it will work on Windows 8, since there is no option as sidebar in Windows 8.
If possible please tell what should I do to make it compatible with both Windows 7 and Windows 8.
Windows Desktop Gadgets are not supported on Win8: http://www.techradar.com/news/software/operating-systems/microsoft-to-remove-desktop-gadgets-from-windows-8-1088122
You can try to reuse some parts of your code to make a Windows 8 'immersive app' with a Live Tile. The C#/XAML stack in Windows 8 is quite similar to Silverlight (but not the same). See http://msdn.microsoft.com/en-us/library/windows/apps/hh465136.aspx for a guide about the differences.

Metro style app (Elysium) build on windows 8 not work on windows 7

I build some metro style apps with 1 form. My os - Windows 8, and I use Visual studio 2010.
If I create metro style apps using MahApps.Metro - everything fine - they run on windows 7.
But if I use Elysium.theme - my apps doesn't run on windows 7.
Can somebody help me to solve this problem?
P.s. The sample from http://elysium.codeplex.com/ work fine both win 7 and win 8.
Elysium has both uses 4.0 and 4.5 of .Net, Please find which you have added as reference in your project. Better use 4.0, so that it can run on both OS.

Is prism using legacy code?

We are using prism for developing WPF applications. The newest(4.1) version supports only windows 7 and windows server 2008 as per the following link
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=28950
This begs a question. As far as I know specific operating system support is only required for assemblies with legacy code. If the assembly is completely written in .NET it just need the .NET frame work support as this itself is a "virtual machine".
If this is true is prism contains legacy code?
The Prism 4.1 Deveoper's Guide provided here says the following:
This guidance was designed to run on the Microsoft Windows 7, Windows Vista, or Windows Server 2008 operating system. This version has been smoke tested on Windows XP Professional and Windows Server 2003, but it has not been exhaustively tested. WPF applications built using this guidance require the .NET Framework 4.0 and Silverlight applications require Silverlight 5.
All this means is that they haven't tested it on XP, but you needed XP SP 3 and above for the last release (the minimum for .NET 4.0), so my guess is it will likely work for new projects.
No need to panic.

Resources