I'm creating a toast message on the top of page my when i receive a push notification messages like this, so u can create widgets like this (or pages i suppose).Hope that helps u.
var pw = new Android.Widget.PopupWindow(Xamarin.Forms.Forms.Context); //create a window
var layout = new Android.Widget.RelativeLayout(Xamarin.Forms.Forms.Context);
pw.ContentView = layout; //create your layout holder
pw.Width = 100; //set window sizes
pw.Height = 100;
pw.WindowLayoutType = WindowManagerTypes.Toast; //window type (there are some other types too, just investigate :)
var tv = new Android.Widget.TextView(Xamarin.Forms.Forms.Context); //create a text and add to your layout holder
tv.Text = "Hello";
layout.AddView(tv);
pw.ShowAtLocation(layout, GravityFlags.Top, 0, 0); //show your window
You can dismiss the window via pw.Dissmiss() but i'm using a timerbecause it is a toast
var timer = new System.Timers.Timer();
timer.Interval = 5000; //5 seconds
timer.Elapsed += (sender, e) =>
{
timer.Stop();
Device.BeginInvokeOnMainThread(() =>
{
pw.Dismiss();
});
};
timer.Start();
You can inflate a predefined xaml too i think but you have to google a little :)