Windows Phone Device Model and Version in Windows Phone Silverlight 8.1 App

MainPage.Xaml

 

  1. <Grid x:Name="LayoutRoot" Background="LightBlue">  
  2.     <TextBlock Text="Windows Model :" TextWrapping="Wrap" FontSize="20" Foreground="Gray" Margin="148,284,167,449" />  
  3.     <TextBlock Name="txtModel" TextWrapping="Wrap" FontSize="24" Foreground="Gray" Margin="130,310,135,423" />  
  4.     <TextBlock Text="Windows Version :" TextWrapping="Wrap" FontSize="20" Foreground="Gray" Margin="142,344,163,397" />  
  5.     <TextBlock Name="txtVrsn" TextWrapping="Wrap" FontSize="24" Foreground="Gray" Margin="28,370,26,358" />   
  6. </Grid>  

 

MainPage.Xaml.cs

 

  1. public MainPage()  
  2. {  
  3.     InitializeComponent();  
  4.     var phone = PhoneNameResolver.Resolve(DeviceStatus.DeviceManufacturer, DeviceStatus.DeviceName);  
  5.     txtModel.Text = Convert.ToString(phone.FullCanonicalName);  
  6.     txtVrsn.Text = Convert.ToString(System.Environment.OSVersion);  
  7.   
  8.      
  9. }