Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Added test in controls gallery for issue #13258 #13449

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<controls:TestContentPage
xmlns:controls="clr-namespace:Xamarin.Forms.Controls"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Controls.Issues.Issue13258"
Title="Issue 13258">

<StackLayout>
<Button Text="PushModal" Clicked="PushModal_Clicked" />
<Button Text="PushModal with BackgroundColor" Clicked="PushModalWithBackground_Clicked" />
</StackLayout>

</controls:TestContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 13258, "[Bug] After PopModalAsync will not call OnAppearing (iOS)", PlatformAffected.iOS)]
public partial class Issue13258 : TestContentPage
{
public Issue13258()
{
#if APP
InitializeComponent();
#endif
}

protected override void Init()
{

}

void PushModal_Clicked(System.Object sender, System.EventArgs e)
{
Navigation.PushModalAsync(new Issue13258_ModalPage());
}

void PushModalWithBackground_Clicked(System.Object sender, System.EventArgs e)
{
Navigation.PushModalAsync(new Issue13258_ModalPage()
{
BackgroundColor = Color.Red,
});
}

protected override void OnAppearing()
{
System.Diagnostics.Debug.WriteLine("Issue13258 OnAppearing");
base.OnAppearing();
}

protected override void OnDisappearing()
{
System.Diagnostics.Debug.WriteLine("Issue13258 OnDisappearing");
base.OnDisappearing();
}

public class Issue13258_ModalPage : ContentPage
{
public Issue13258_ModalPage()
{
Title = "Issue13258 ModalPage";

var stackLayout = new StackLayout()
{
VerticalOptions = LayoutOptions.Center,
};

var button = new Button()
{
Text = "PopModal",
VerticalOptions = LayoutOptions.Center,
};
button.Clicked += (sender, e) => {
Navigation.PopModalAsync();
};

stackLayout.Children.Add(button);

Content = stackLayout;
}

protected override void OnAppearing()
{
System.Diagnostics.Debug.WriteLine("Issue13258_ModalPage OnAppearing");
base.OnAppearing();
}

protected override void OnDisappearing()
{
System.Diagnostics.Debug.WriteLine("Issue13258_ModalPage OnDisappearing");
base.OnDisappearing();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
<Compile Include="$(MSBuildThisFileDirectory)Issue12344.xaml.cs">
<DependentUpon>Issue12344.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Issue13258.xaml.cs">
<DependentUpon>Issue13258.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Issue12246.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue12429.xaml.cs">
<DependentUpon>Issue12429.xaml</DependentUpon>
Expand Down Expand Up @@ -2604,6 +2607,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue13258.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue2447.xaml">
Expand Down