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

            Interfaces.DeviceOrientation orientation = orientationService.GetOrientation();
            lblOrientacion.Text = orientation.ToString();
        }
예제 #2
0
 public OrientationViewModel()
 {
     ChangeOrientation = new Command(async() =>
     {
         IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>();
         DeviceOrientation orientation     = service.GetOrientation();
         Result = orientation.ToString();
     });
 }
예제 #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;
        }
예제 #4
0
        public DeviceViewModelPage()
        {
            GetDeviceCommand = new Command(() =>
            {
                IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>();
                DeviceOrientation orientation     = service.GetOrientation();

                ShowData = orientation.ToString();
            });
        }
예제 #5
0
        public HomeViewModel(IDeviceOrientationService deviceOrientarionService)
        {
            DeviceOrientationService = deviceOrientarionService;

            var orientation = DeviceOrientationService.GetOrientation();

            Orientation = orientation.ToString();

            GetOrientarionCommand = new Command(OnGetOrientarion);
        }
예제 #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");
            });
        }
예제 #7
0
        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");
            }
        }
예제 #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();
 }
예제 #10
0
        private void GetOrientation()
        {
            var orientation = _deviceOrientation.GetOrientation();

            ShowOrientation = orientation.ToString();
        }
예제 #11
0
        public void GetOrientation()
        {
            var orientation = _deviceOrientationService.GetOrientation();

            Orientation = orientation.ToString();
        }