Skip to content

Instantly share code, notes, and snippets.

@amay077
Created March 26, 2013 14:51
Show Gist options
  • Select an option

  • Save amay077/5245949 to your computer and use it in GitHub Desktop.

Select an option

Save amay077/5245949 to your computer and use it in GitHub Desktop.
Xamarin Component Store を眺めてみる ref: http://qiita.com/items/811cdd8ab3d1243045b6
<省略>
using Xamarin.Controls;
namespace AlertCenterSample
{
[Activity (Label = "AlertCenterSample", MainLauncher = true)]
public class Activity1 : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button>(Resource.Id.myButton);
button.Click += delegate
{
AlertCenter.Default.Init (Application);
AlertCenter.Default.PostMessage ("Knock knock!", "Who's there?", Resource.Drawable.Icon);
AlertCenter.Default.PostMessage ("Interrupting cow.", "Interrupting cow who?",
Resource.Drawable.Icon, () => {
Console.WriteLine ("Moo!");
});
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment