共通コード(App.xaml.csで)
public static int ScreenHeight {get; set;}
public static int ScreenWidth {get; set;}
Androidの一部(MainActivity.csで、目で選択した方法で構築する方法を検索電子OnCreate関数法)
App.ScreenHeight = (int) (Resources.DisplayMetrics.HeightPixels/Resources.DisplayMetrics.Density);
App.ScreenWidth = (int) (Resources.DisplayMetrics.WidthPixels/Resources.DisplayMetrics.Density);
iOSの部分(AppDelegate.csで、中FinishedLaunching法)
App.ScreenHeight = (int)UIScreen.MainScreen.Bounds.Height;
App.ScreenWidth = (int)UIScreen.MainScreen.Bounds.Width;
アプリケーションがされるときにApp.ScreenHeightとApp.ScreenWidthが初期化されます
共通のコードのどこにでもそれらを使用できるようになります。
Windows UWPはどうですか? – jbyrd