I found a solution for this:
I created this variable:
ResolutionScale resolutionScale = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().ResolutionScale;
and then I used a switch statement:
switch (resolutionScale)
{
case ResolutionScale.Scale100Percent:
//Device is 100
break;
case ResolutionScale.Scale140Percent:
//Device is 140
break;
case ResolutionScale.Scale180Percent:
//Device is 180
break;
}