Question: do I need to have different images for different screen sizes for iOS for (4s 5s, and above)?
how can we set retain dimensions of images/Icons and controls across the screen sizes and resolutions in iOS (using Xamarin forms).
please refer this to understand problem 
[Autolayout and proportional positioning](https://stackoverflow.com/questions/20192907/autolayout-and-proportional-positioning?rq=1)

but I need solution for xamarin forms.

Answer: 
I assume you're constucting an instance of one of your inherited classes and you don't know what the type will be on construction (so `SolarPanel.Name` isn't an option).

You can do:

```
this.getType().GetProperty("Name").GetValue(this, null);

```

But if all your types don't have the `Name` property, you should null check `GetProperty` first:

```
var prop = this.getType().GetProperty("Name");
string name = "";

if (prop != null)
{
    name = prop.GetValue(this, null);
} 

```
Here is an approach with `Attributes`:

```
[AttributeUsage(AttributeTargets.Class)]
public class NameAttribute : Attribute {
    public readonly string Name;

    public NameAttribute(string name) {
        this.Name = name;
    }
}

public static class Extensions {
    /// <summary>
    /// If existant, returns the name tag for given object, else null
    /// </summary>
    public static string GetNameTag(this object instance) {
        return instance.GetType().GetNameTag();
    }

    /// <summary>
    /// If existant, returns the name tag for given type, else null
    /// </summary>
    public static string GetNameTag(this Type type) {
        object[] names = type.GetCustomAttributes(typeof(NameAttribute), false);
        switch(names.Length) {
            case 0:
                return null;
            case 1:
                return ((NameAttribute)names[0]).Name;
            default:
                throw new FormatException();
        }
    }
}

[Name("Headquater")]
public class Headquater : Building {
    // ...
}

[Name("Solar Panel")]
public class Solarpanel : Building {
    // ...
}

```

Now, you can simply do:

```
object panel = new SolarPanel();
Console.WriteLine(panel.GetNameTag());

```

And:

```
Console.WriteLine(typeof(SolarPanel).GetNameTag());

```