Fire Page Appearing event

There's not really a great time to do this so I settled on
firing it when it's converted to a Ooui element.

Fixes #116
This commit is contained in:
Frank A. Krueger 2018-03-23 12:40:51 -07:00
parent 0a8898e1b2
commit e65b3a335d
No known key found for this signature in database
GPG Key ID: 0471C67474FFE664
3 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,8 @@ namespace Xamarin.Forms
if (existingRenderer != null) if (existingRenderer != null)
return existingRenderer.NativeView; return existingRenderer.NativeView;
((IPageController)page).SendAppearing ();
return CreateElement (page); return CreateElement (page);
} }

View File

@ -22,6 +22,7 @@
</StackLayout> </StackLayout>
<Button Text="Tap to Display Alert" <Button Text="Tap to Display Alert"
Clicked="OnButtonClicked" /> Clicked="OnButtonClicked" />
<Label x:Name="status" />
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View File

@ -14,6 +14,13 @@ namespace Samples
InitializeComponent (); InitializeComponent ();
} }
protected override void OnAppearing ()
{
base.OnAppearing ();
status.Text = "Page appeared";
}
public async void OnButtonClicked(object sender, EventArgs args) public async void OnButtonClicked(object sender, EventArgs args)
{ {
activity.IsRunning = true; activity.IsRunning = true;