public void ClickBoton(object sender, EventArgs args) { IDeviceOrientationService orientationService = DependencyService.Get <IDeviceOrientationService>(); Interfaces.DeviceOrientation orientation = orientationService.GetOrientation(); lblOrientacion.Text = orientation.ToString(); }
public OrientationViewModel() { ChangeOrientation = new Command(async() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); Result = orientation.ToString(); }); }
public BaseViewModel(INavigationService navigationService, IPageDialogService dialogService, IUserServices userServices, IDeviceOrientationService deviceOrientationService, IDependencyService dependencyService) { DeviceOrientation orientation = deviceOrientationService.GetOrientation(); this.navigationService = navigationService; this.dialogService = dialogService; this.userServices = userServices; this.deviceOrientationService = deviceOrientationService; }
public DeviceViewModelPage() { GetDeviceCommand = new Command(() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); ShowData = orientation.ToString(); }); }
public HomeViewModel(IDeviceOrientationService deviceOrientarionService) { DeviceOrientationService = deviceOrientarionService; var orientation = DeviceOrientationService.GetOrientation(); Orientation = orientation.ToString(); GetOrientarionCommand = new Command(OnGetOrientarion); }
public DevicePageViewModel() { //Comando para boton GetDeviceORientation, este dara la orientacion del dispositivo GetOrientationCommand = new Command(() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); App.Current.MainPage.DisplayAlert("Orientacion", orientation.ToString(), "ok"); }); }
private void GetOrientationClicked(object sender, EventArgs e) { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); if (orientation == DeviceOrientation.Landscape) { DisplayAlert("Alert", "Its Landscape", "OK"); } else if (orientation == DeviceOrientation.Portrait) { DisplayAlert("Alert", "Its Portrait", "OK"); } }
public HomePageViewModel() { GetDeviceOrientationCommand = new Command(async() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); if (orientation.IsLandscape()) { await App.Current.MainPage.DisplayAlert("Orientation", "The device orientation is Landscape", "Ok"); } else { await App.Current.MainPage.DisplayAlert("Orientation", "The device orientation is Portrait", "Ok"); } }); }
public NewMailPageViewModel(INavigationService inavigarionServices, IPageDialogService dialogService, IUserServices userServices, IDeviceOrientationService deviceOrientationService, IDependencyService dependencyService) : base(inavigarionServices, dialogService, userServices, deviceOrientationService, dependencyService) { deviceOrientationService.GetOrientation(); }
private void GetOrientation() { var orientation = _deviceOrientation.GetOrientation(); ShowOrientation = orientation.ToString(); }
public void GetOrientation() { var orientation = _deviceOrientationService.GetOrientation(); Orientation = orientation.ToString(); }