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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Selva GanapathyRank #560 · 4.3K reputationPosted Dec 23, 2014, 10:22 AM EST
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
VulpesRank #55 · 29.2K reputationPosted Dec 20, 2014, 2:50 AM EST
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.
Michal HabalcikRank #902 · 2.3K reputationPosted Dec 19, 2014, 8:44 PM EST
System.OperatingSystem osInfo = System.Environment.OSVersion;
or you can write it to a string directly:
System.Environment.OSVersion.ToString();
Mike Steve64 reputationPosted Dec 19, 2014, 9:15 PM EST
Michal HabalcikRank #902 · 2.3K reputationPosted Dec 19, 2014, 9:23 PM EST
Here is more info about the topic: http://msdn.microsoft.com/en-us/library/windows/apps/windows.security.exchangeactivesyncprovisioning.easclientdeviceinformation.aspx
Mike Steve64 reputationPosted Dec 19, 2014, 10:46 PM EST