I just got how to solve my problem. I've used a diferent approach, with async method and Sockets. I've called this bellow method in the StartPage constructor and the testData has showed the desired value.
private async void getIPs() {
HostName serverHost = new HostName("www.stackoverflow.com");
var clientSocket = new Windows.Networking.Sockets.StreamSocket();
// Try to connect to the remote host
await clientSocket.ConnectAsync(serverHost, "http");
// Get the HostName as DisplayName, CanonicalName, Raw with the IpAddress.
var ipAddress = clientSocket.Information.RemoteAddress.DisplayName;
testData.Text += ipAddress;
}