1
0

Added some basic OS properties

This commit is contained in:
Benjamin Höglinger-Stelzer 2018-10-22 19:22:11 +02:00
parent 692d21d437
commit 20c8d62a21
5 changed files with 1145 additions and 24 deletions

View File

@ -16,6 +16,7 @@
</ResourceDictionary.MergedDictionaries>
<Style TargetType="Label">
<Setter Property="FontFamily" Value="Segoe UI Light"/>
<Setter Property="FontSize" Value="24px"/>
</Style>
</ResourceDictionary>
</Application.Resources>

View File

@ -70,6 +70,7 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Util\OSVersionInfo.cs" />
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>

View File

@ -9,24 +9,37 @@
Title="Derping Drivers - Windows driver settings detection tool"
Height="450" Width="800"
ShowMaxRestoreButton="False"
ResizeMode="NoResize">
<Grid>
ResizeMode="NoResize"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
<Grid Margin="15">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" />
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0">Windows version name:</Label>
<Label Grid.Row="0" Grid.Column="2" Content="{Binding Path=OsVersionName}"/>
<Label Grid.Row="1" Grid.Column="0">Windows version number:</Label>
<Label Grid.Row="1" Grid.Column="2" Content="{Binding Path=OsVersion}"/>
<Label Grid.Row="2" Grid.Column="0">Windows architecture:</Label>
<Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=OsArchitecture}"/>
</Grid>
</Grid>
</Controls:MetroWindow>

View File

@ -1,23 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using DerpingDrivers.Util;
using MahApps.Metro.Controls;
namespace DerpingDrivers
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : MetroWindow
{
@ -25,5 +12,21 @@ namespace DerpingDrivers
{
InitializeComponent();
}
/// <summary>
/// Operating System Architecture display name
/// </summary>
public string OsArchitecture =>
OsVersionInfo.OsBits == OsVersionInfo.SoftwareArchitecture.Bit64 ? "64-bit" : "32-bit";
/// <summary>
/// Operating System display name
/// </summary>
public string OsVersionName => $"{OsVersionInfo.Name} {OsVersionInfo.Edition}";
/// <summary>
/// Operating System build number
/// </summary>
public string OsVersion => OsVersionInfo.VersionString;
}
}

File diff suppressed because it is too large Load Diff