public AprobarDocSubirDocumento(RevisionDocumento datos) { documentoRevision = datos; BindingContext = datos; InitializeComponent(); }
private async void BtnAprobarDocumento_ClickedAsync(object sender, EventArgs e) { bool displayFlag = false; if (rol.Equals("1003") || rol.Equals("1004")) { //Bundle bundle = new Bundle(); RevisionDocumento docDatos = new RevisionDocumento { usuarioId = Int32.Parse(usuarioId), documentoId = documentoSeleccionado.DocumentoId, esRechazado = "No", observacion = "", perfil = rol, nombre = documentoSeleccionado.NombreArchivo.ToString() }; var documentosEnTramite = new AprobarDocSubirDocumento(docDatos as RevisionDocumento); //await rootPage.Navigation.PushAsync(documentosEnTramite); //await App.Current.MainPage .Navigation.PushAsync(documentosEnTramite); //App.Current.MainPage = new AprobarDocSubirDocumento(docDatos as object); await Navigation.PushAsync(documentosEnTramite); await Task.Delay(200); await PopupNavigation.Instance.PopAllAsync(); } else { var answer = await DisplayAlert("Confirmar", "Seguro que desea aprobar documento ?", "Si", "No"); if (!answer) { return; } String IP_LEGAL = App.Current.Properties["IpPublicado"].ToString(); String url = IP_LEGAL + "/legal/RevisionDocumento/RevizarDocumentoJson"; var post = new { usuarioId = usuarioId, documentoId = documentoSeleccionado.DocumentoId, esRechazado = "No", observacion = "", perfil = rol, fileImagenOrPdf = "", nombre = "", esImagen = false, }; var service = new RestClient <Documento>(); documento = await service.GetRestServicieDataPostAsync(url, post); ObservableCollection <Documento.Datum> docDatas = new ObservableCollection <Documento.Datum>(documento.data); //await DisplayAlert("Documento: " + datum.DocumentoId, documento.mensaje, "OK"); String message = documento.mensaje; //if (Device.OS == TargetPlatform.Android) //{ // DependencyService.Get<IMessage>().ShortAlert(message); //} //if (Device.OS == TargetPlatform.iOS) //{ // DependencyService.Get<IMessage>().ShortAlert(message); //} #region Utilizando la libreria popup Rg.Plugins.Popup.Pages.PopupPage popupPage = new Rg.Plugins.Popup.Pages.PopupPage(); Label label = new Label(); label.Text = message; label.TextColor = Color.White; //label.BackgroundColor = Color.FromHex("#232323"); label.VerticalTextAlignment = TextAlignment.Center; label.HeightRequest = 48; //label.Margin = new Thickness(16, 0, 0, 0); var scaleAnimation = new ScaleAnimation { PositionIn = MoveAnimationOptions.Bottom, PositionOut = MoveAnimationOptions.Bottom, ScaleIn = 2, ScaleOut = 2, //DurationIn = 400, //DurationOut = 800, EasingIn = Easing.Linear, HasBackgroundAnimation = true, }; popupPage.Animation = scaleAnimation; popupPage.Content = new FlexLayout { Direction = FlexDirection.Column, JustifyContent = FlexJustify.End, BackgroundColor = Color.Transparent, Margin = 0, //Padding = new Thickness(16, 0, 0, 0), HeightRequest = 50, WidthRequest = 70, Children = { new StackLayout { BackgroundColor = Color.FromHex("#232323"), Margin = 0, Padding = new Thickness(16, 0), Children = { label } } } }; //popupPage.HeightRequest = 50; await PopupNavigation.Instance.PushAsync(popupPage); await Task.Delay(2000); await PopupNavigation.Instance.PopAllAsync(); #endregion fin usando la liberia popup } }