Created
March 26, 2013 14:51
-
-
Save amay077/5245949 to your computer and use it in GitHub Desktop.
Xamarin Component Store を眺めてみる ref: http://qiita.com/items/811cdd8ab3d1243045b6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <省略> | |
| 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