Skip to content

Commit

Permalink
Added test in controls gallery for issue xamarin#13258
Browse files Browse the repository at this point in the history
  • Loading branch information
beeradmoore committed Jan 18, 2021
1 parent 51ca97b commit 3c23c60
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 0 deletions.
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

0 comments on commit 3c23c60

Please sign in to comment.