Beispiel #1
0
        public void ClickBoton(object sender, EventArgs args)
        {
            IDeviceOrientationService orientationService = DependencyService.Get <IDeviceOrientationService>();

            Interfaces.DeviceOrientation orientation = orientationService.GetOrientation();
            lblOrientacion.Text = orientation.ToString();
        }
Beispiel #2
0
 public OrientationViewModel()
 {
     ChangeOrientation = new Command(async() =>
     {
         IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>();
         DeviceOrientation orientation     = service.GetOrientation();
         Result = orientation.ToString();
     });
 }
Beispiel #3
0
        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;
        }
Beispiel #4
0
        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);
        }
Beispiel #6
0
        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");
            }
        }
Beispiel #8
0
 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();
 }
Beispiel #10
0
        private void GetOrientation()
        {
            var orientation = _deviceOrientation.GetOrientation();

            ShowOrientation = orientation.ToString();
        }
        public void GetOrientation()
        {
            var orientation = _deviceOrientationService.GetOrientation();

            Orientation = orientation.ToString();
        }