public void ClickBoton(object sender, EventArgs args) { IDeviceOrientationService orientationService = DependencyService.Get <IDeviceOrientationService>(); Interfaces.DeviceOrientation orientation = orientationService.GetOrientation(); lblOrientacion.Text = orientation.ToString(); }
public static IObservable <DeviceOrientations> ObserveDeviceIsInLandscape(this IDeviceOrientationService service) { return(Observable.FromEventPattern <EventHandler <DeviceOrientationChangedEventArgs>, DeviceOrientationChangedEventArgs>( handler => service.NotifyOrientationChanged += handler, handler => service.NotifyOrientationChanged -= handler ) .Select(args => args.EventArgs.DeviceOrientation) .Where(deviceOrientation => deviceOrientation == DeviceOrientations.Left || deviceOrientation == DeviceOrientations.Right)); }
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 OrientationViewModel() { ChangeOrientation = new Command(async() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); Result = orientation.ToString(); }); }
public DeviceViewModelPage() { GetDeviceCommand = new Command(() => { IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); DeviceOrientation orientation = service.GetOrientation(); ShowData = orientation.ToString(); }); }
public DSPageViewModel(ITextToSpeechService textToSpeech, IDeviceOrientationService deviceOrientation, IPhotoPickerService photoPicker) { _textToSpeech = textToSpeech; _deviceOrientation = deviceOrientation; _photoPicker = photoPicker; OnSpeakCommandClicked = new DelegateCommand(Speak); OnOrientationCommandClicked = new DelegateCommand(GetOrientation); OnPhotoPickerCommandClicked = new DelegateCommand(PickPhoto); }
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"); }); }
protected override void OnAppearing() { base.OnAppearing(); Console.WriteLine("LOG: METHOD RAN"); if (!nextMedia) { DependencyService.Get <IFullscreenService>().EnterFullscreen(); IDeviceOrientationService service = DependencyService.Get <IDeviceOrientationService>(); service.ForceLandscape(); } nextMedia = false; }
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 DraftsPageViewModel(INavigationService inavigarionServices, IPageDialogService dialogService, IUserServices userServices, IDeviceOrientationService deviceOrientationService, IDependencyService dependencyService) : base(inavigarionServices, dialogService, userServices, deviceOrientationService, dependencyService) { deviceOrientationService = dependencyService.Get <IDeviceOrientationService>(); IsPresentCommand = new DelegateCommand(() => { MessagingCenter.Send(this, "IsPresentKey", IsPresent); }); }
public NewMailPageViewModel(INavigationService inavigarionServices, IPageDialogService dialogService, IUserServices userServices, IDeviceOrientationService deviceOrientationService, IDependencyService dependencyService) : base(inavigarionServices, dialogService, userServices, deviceOrientationService, dependencyService) { deviceOrientationService.GetOrientation(); }
public WaitingCarLandscapeViewModel(IDeviceOrientationService deviceOrientationService) { _deviceOrientationService = deviceOrientationService; }
public ReceivedPageViewModel(INavigationService inavigarionServices, IPageDialogService dialogService, IUserServices userServices, IDeviceOrientationService deviceOrientationService, IDependencyService dependencyService) : base(inavigarionServices, dialogService, userServices, deviceOrientationService, dependencyService) { LoadList(); IsPresentCommand = new DelegateCommand(() => { MessagingCenter.Send(this, "IsPresentKey", IsPresent); }); NewMailCommand = new DelegateCommand(() => { navigationService.NavigateAsync(new Uri($"{ConfigPage.MenuMasterDetailPage}{ConfigPage.NavigationPage}{ConfigPage.ReceivedPage}{ConfigPage.NewMailPage}")); }); }
public DeviceOrientationPageViewModel(IDeviceOrientationService deviceOrientationService) { DeviceOrientationService = deviceOrientationService; GetDeviceOrientationCommand = new DelegateCommand(ExecuteGetDeviceOrientationCommand); }
public MenuMasterDetailPageViewModel(INavigationService navigationService, IPageDialogService dialogService, IUserServices userServices, IDeviceOrientationService deviceOrientationService, IDependencyService dependencyService) : base(navigationService, dialogService, userServices, deviceOrientationService, dependencyService) { ItemsMasters = new ObservableCollection <ItemMasters>() { new ItemMasters() { Image = "OutBoxImage", Title = "Inbox", Page = $"{ConfigPage.NavigationPage}{ConfigPage.ReceivedPage}" }, new ItemMasters() { Image = "ic_action_star_borderBlack.png", Title = "Featureds", Page = $"{ConfigPage.NavigationPage}{ConfigPage.FeaturedPage}" }, new ItemMasters() { Image = "ic_action_access_time", Title = "Postponeds", Page = $"{ConfigPage.NavigationPage}{ConfigPage.PostponedPage}" }, new ItemMasters() { Image = "ic_action_label_important", Title = "Importants", Page = $"{ConfigPage.NavigationPage}{ConfigPage.ImportantPage}" }, new ItemMasters() { Image = "ic_action_send", Title = "Sends", Page = $"{ConfigPage.NavigationPage}{ConfigPage.SendsPage}" }, new ItemMasters() { Image = "ic_action_access_time", Title = "Scheduled", Page = $"{ConfigPage.NavigationPage}{ConfigPage.ScheduledPage}" }, new ItemMasters() { Image = "UploadImage", Title = "OutBox", Page = $"{ConfigPage.NavigationPage}{ConfigPage.OutboxPage}" }, new ItemMasters() { Image = "paperImage", Title = "Drafts", Page = $"{ConfigPage.NavigationPage}{ConfigPage.DraftsPage}" }, new ItemMasters() { Image = "emailImage", Title = "Alls", Page = $"{ConfigPage.NavigationPage}{ConfigPage.AllMailPage}" }, new ItemMasters() { Image = "ic_action_error_outline", Title = "Spam", Page = $"{ConfigPage.NavigationPage}{ConfigPage.SpamPage}" }, new ItemMasters() { Image = "ic_action_delete_outline.png", Title = "Recycle Bin", Page = $"{ConfigPage.NavigationPage}{ConfigPage.RecycleBinPage}" } }; SelectPageCommand = new DelegateCommand <string>(NavigateAsync); MessagingCenter.Subscribe <ReceivedPageViewModel, bool>(this, "IsPresentKey", (param, sender) => { IsPresent = sender; }); }
public OrientationViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceOrientationService deviceOrientationService) : base(navigationService, pageDialogService) { _deviceOrientationService = deviceOrientationService; GetDeviceOrientation = new DelegateCommand(GetOrientation); }