//================================================== /*-------------------------------------- * * Constructor * * -----------------------------------*/ public MenuPage() { InitializeComponent(); vms = new MenuPageViewModel(); BindingContext = vms; BackgroundImageSource = vms.GetImageSource(); }
//================================================== /*--------------------------------- * * Event to update the background image * if the device orientation changes * * -------------------------------*/ protected override void OnSizeAllocated(double width, double height) { vms.DeviceScreen.GetScreenDetails(); BackgroundImageSource = vms.GetImageSource(); vms.ButtonHeight = (int)vms.DeviceScreen.Height / 4; base.OnSizeAllocated(width, height); }