I have a XAML file which is not show here. How do I to set the 'Visibility' of a field to 'Hidden' or 'Visible' based on the results of the OsCheck class method? Basically, I want the field Visibility to be 'Hidden' if the windows version is 7.
namespace My.namespace.is.secret
{
public partial class MyClass: IValueConverter
{
public bool OsCheck(){
System.OperatingSystem os = System.Environment.OSVersion;
//Get version information about the os.
System.Version vs = os.Version;
if ((os.Platform == PlatformID.Win32NT) &&
(vs.Major == 6) &&
(vs.Minor != 0))
{
return true; //operatingSystem == "7";
}
else return false;
}
}
}