1
Use Rg.Popup.Plugins for popup creation. Well, when I put in project it doesn’t run, the screen darkens, but I click on it and nothing happens. I put a button with a red background and it still doesn’t appear. I did a project and it works. In my project I use Syncfusion (Datagrid and Chart), I use the plugin Firebasepushnotification, the difference to the other project. I thought some of this might be killing my Popup. See below the code used. XAML
<?xml version="1.0" encoding="utf-8" ?>
<pages:PopupPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:pages="clr-namespace:Rg.Plugins.Popup.Pages;assembly=Rg.Plugins.Popup"
xmlns:animations="clr-namespace:Rg.Plugins.Popup.Animations;assembly=Rg.Plugins.Popup"
x:Class="Autorizador.AprovarPopup">
<!--Animations use example-->
<StackLayout>
<Label Text="Testando" BackgroundColor="Black" TextColor="Yellow"></Label>
</StackLayout>
<!--<pages:PopupPage.Animation>
<animations:ScaleAnimation
PositionIn="Center"
PositionOut="Center"
ScaleIn="1.2"
ScaleOut="0.8"
DurationIn="400"
DurationOut="300"
EasingIn="SinOut"
EasingOut="SinIn"
HasBackgroundAnimation="True"/>
</pages:PopupPage.Animation>-->
<StackLayout VerticalOptions="End" HorizontalOptions="Fill">
<Button Margin="20,0,20,20" HeightRequest="80" Text="Fechar" Clicked="Fechar_OnClicked" BackgroundColor="Red"></Button>
</StackLayout>
</pages:PopupPage>
mine . Cs
using Rg.Plugins.Popup.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Rg.Plugins.Popup.Extensions;
namespace Autorizador
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AprovarPopup : PopupPage
{
private TaskCompletionSource<bool> taskCompletionSource;
public Task PopupClosedTask { get { return taskCompletionSource.Task; } }
public AprovarPopup()
{
InitializeComponent();
}
//protected override void OnAppearing()
//{
// base.OnAppearing();
// taskCompletionSource = new TaskCompletionSource<bool>();
// Debug.WriteLine("I'm getting rendered");
//}
//protected override void OnDisappearing()
//{
// base.OnDisappearing();
// taskCompletionSource.SetResult(true);
//}
//// Method for animation child in PopupPage
//// Invoced after custom animation end
//protected override Task OnAppearingAnimationEnd()
//{
// return Content.FadeTo(0.5);
//}
//// Method for animation child in PopupPage
//// Invoked before custom animation begin
//protected override Task OnDisappearingAnimationBegin()
//{
// return Content.FadeTo(1);
//}
//protected override bool OnBackButtonPressed()
//{
// // Prevent hide popup
// //return base.OnBackButtonPressed();
// return true;
//}
//// Invoced when background is clicked
//protected override bool OnBackgroundClicked()
//{
// // Return default value - CloseWhenBackgroundIsClicked
// return base.OnBackgroundClicked();
//}
//private async void Fechar_OnClicked(object sender, EventArgs e)
//{
// await base.Navigation.PopPopupAsync();
//}
}
}
see that there are some methods commented, because I did it to see if it is or not some of these methods.
EDIT1
Along those lines public partial class AprovarPopup : PopupPage
, when I click F12 on top of Popuppage gives me this message:
Cannot navigate to symbol under cursor
This could be the problem that’s going on, I’m not inheriting anything or not?
What it seems is that Popuppage is not being recognized and I do not know why.
EDIT2
I created another form with popup and it worked. That was the answer. Post closed, thank you.