Created
April 25, 2016 17:17
-
-
Save Parmendrak/4c9cf8883b447e7d6c8566a13f093398 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 System; | |
using Xamarin.Forms; | |
namespace xvfgdgfd | |
{ | |
public class App : Application | |
{ | |
Label resultsLabel; | |
SearchBar searchBar; | |
public App () | |
{ | |
resultsLabel = new Label { | |
Text = "Result will appear here.", | |
VerticalOptions = LayoutOptions.FillAndExpand, | |
FontSize = 25 | |
}; | |
searchBar = new SearchBar | |
{ | |
Placeholder = "Enter search term", | |
SearchCommand = new Command(() => {resultsLabel.Text = "Result: " + searchBar.Text + " is what you asked for.";}) | |
}; | |
MainPage = new ContentPage { | |
Content = new StackLayout { | |
VerticalOptions = LayoutOptions.Start, | |
Children = { | |
new Label { | |
HorizontalTextAlignment = TextAlignment.Center, | |
Text = "SearchBar", | |
FontSize = 50 | |
}, | |
searchBar, | |
new ScrollView | |
{ | |
Content = resultsLabel, | |
VerticalOptions = LayoutOptions.FillAndExpand | |
} | |
}, | |
Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5) | |
} | |
}; | |
} | |
protected override void OnStart () | |
{ | |
// Handle when your app starts | |
} | |
protected override void OnSleep () | |
{ | |
// Handle when your app sleeps | |
} | |
protected override void OnResume () | |
{ | |
// Handle when your app resumes | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment