I have a Silverlight3 application that is meant to run on both Windows and Mac OS environments. I would like to know in runtime if my application is running on a Windows or Mac so I can tweak a few things to the way users are accustomed to in their operating system of choice.
For example, in Windows it is the norm to use "OK" "Cancel" buttons, while in Mac OS the norm is "Cancel" "OK" buttons (reverse order).
Any ideas?
There are two ways.
From Silverlight:
string os = Environment.OSVersion.Platform.ToString();
string version = Environment.OSVersion.Version.ToString();
From ASP.NET and send it to Silverlight:
StringBuilder sb = new StringBuilder();
sb.AppendFormat("UserAgent={0}", Request.UserAgent);
Xaml1.InitParameters = sb.ToString();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With