Use Rg.Popup.Plugins to create popups. Well, when I put in design does not rotate, the screen dims, but I click on it and nothing happens. I put a button with red background and even then, it does not appear. I did a separate project and it works. In my project I use Syncfusion (Datagrid and Chart), I use the FirebasePushNotification plugin, the difference ~ for the other project. I thought something like that 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>
My .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();
//}
}
}
Please note that some methods have been commented out, as I have done so to see whether or not some of these methods are available.
EDIT1
In this line public partial class AprovarPopup : PopupPage
, when I click on F12 on PopupPage gives me this message:
Can not navigate to the symbol under the cursor
Can this be the problem that is happening, am I not inheriting anything or not?
What is appearing 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.