I am using TextTrimming="CharacterEllipsis" of Textblock in windows 8.1 but Windows 8.0 So it my application only run in any one of the machine?
So can you please help me, how to check a Windows version condition in code behind.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Selva GanapathyPosted Dec 23, 2014, 3:22 PM
Hi Mike,
Currently we are not having any solution to find OS version, but in your mentioned problem,
Windows 8
public enum TextTrimming
{
None = 0,
WordEllipsis = 2,
}
Windows 8.1
public enum TextTrimming
{
None = 0,
CharacterEllipsis = 1,
WordEllipsis = 2,
Clip = 3,
}
So Please try to use like this.
TextBlock textBlock = new TextBlock();
textBlock.TextTrimming = (TextTrimming)1;
Regards,
Selva Ganapathy K
VulpesPosted Dec 20, 2014, 7:50 AM
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/9270b1d2-50c0-4fb7-b20d-07d0451c04cb/how-to-get-the-os-version-in-metro-style-app
If you have something which works in Windows 8.1 but not Windows 8.0, I suggest you create versions of your app for both.
Mike StevePosted Dec 20, 2014, 3:46 AM
Michal HabalcikPosted Dec 20, 2014, 2:23 AM
Here is more info about the topic: http://msdn.microsoft.com/en-us/library/windows/apps/windows.security.exchangeactivesyncprovisioning.easclientdeviceinformation.aspx
Mike StevePosted Dec 20, 2014, 2:15 AM
Michal HabalcikPosted Dec 20, 2014, 1:44 AM
System.OperatingSystem osInfo = System.Environment.OSVersion;
or you can write it to a string directly:
System.Environment.OSVersion.ToString();