How to copy files to a Hyper-V VM
Here is a quick and easy way to get this work efficiently:
- If you’re running the VM, turn it off first.
- find your virtual hard disk image file .vhd of your VM
- Right click on this file and select mount
- This will give “System Reserved” and “Local Disk” drives.
- Open the “Local Disk” drive (this is the OS drive on VM)
- Go there and paste you files.
- Finally unmount or eject one of the drivers
- Run the VM and go the c:\ drive there and you will find your files.
Reference: StackOverFlow
How to check the network status in UWP
You can get a variety of network status by the follow code:
/// <summary>
/// Property that returns the connection profile [ ie, availability of Internet ]
/// Interface type can be [ 1,6,9,23,24,37,71,131,144 ]
/// 1 - > Some other type of network interface.
/// 6 - > An Ethernet network interface.
/// 9 - > A token ring network interface.
/// 23 -> A PPP network interface.
/// 24 -> A software loopback network interface.
/// 37 -> An ATM network interface.
/// 71 -> An IEEE 802.11 wireless network interface.
/// 131 -> A tunnel type encapsulation network interface.
/// 144 -> An IEEE 1394 (Firewire) high performance serial bus network interface.
/// </summary>
public static bool IsConnectedToNetwork
{
get
{
var profile = NetworkInformation.GetInternetConnectionProfile();
if (profile != null)
{
var interfaceType = profile.NetworkAdapter.IanaInterfaceType;
return interfaceType == 71 || interfaceType == 6;
}
return false;
}
}
Reference: MSDN
Why my listviewitems not stretch in UWP listview
You must add the listviewitem style into the XAML file so that the single item can stretch in the listview, like this:
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</ListView.ItemContainerStyle>
or just add the listview attribute:
ItemContainerStyle="{StaticResource ListViewItemExpanded}"
Reference: StackOverFlow