Created
February 17, 2015 10:29
-
-
Save prashantvc/0688add6e6e220d1b741 to your computer and use it in GitHub Desktop.
This file contains 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.Forms; | |
using System.Diagnostics; | |
namespace TBTest | |
{ | |
public class App : Application | |
{ | |
public App () | |
{ | |
// The root page of your application | |
var contentPage = new ContentPage { | |
Content = new StackLayout { | |
VerticalOptions = LayoutOptions.Center, | |
Children = { | |
new Label { | |
XAlign = TextAlignment.Center, | |
Text = "Welcome to Xamarin Forms!" | |
} | |
} | |
} | |
}; | |
contentPage.ToolbarItems.Add ( | |
new ToolbarItem { Text = "One", Order = ToolbarItemOrder.Primary } | |
); | |
var enabledButton = new ToolbarItem { Text = "Enabled", Order = ToolbarItemOrder.Secondary, | |
Command = new Command (() => Debug.WriteLine ("Enabled Button Clicked"), () => true)}; | |
var disabledButton = new ToolbarItem { Text = "Disabled", Order = ToolbarItemOrder.Secondary, | |
Command = new Command (() => Debug.WriteLine ("Disabled Button Clicked"), () => false)}; | |
contentPage.ToolbarItems.Add (enabledButton); | |
contentPage.ToolbarItems.Add (disabledButton); | |
MainPage = new NavigationPage (contentPage); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment