Create an Xamarin Form based application (using Visual Studio) which will displa
ID: 3727981 • Letter: C
Question
Create an Xamarin Form based application (using Visual Studio) which will display the following in two different platforms.
HINTS: If you are using a Windows machine you will not be able to create a Mac platform. However, you can create a Windows Application Platform, Window Phone Platform, and/or Android Platform. If you are using a Mac Machine you cannot create a Windows Phone application. You can use the example code from this chapter and make adjustments to complete the code.
Display:
Your Name
Course Name
Course Number
Date
Explanation / Answer
public EmployeeCell()
{
var image = new Image
{
HorizontalOptions = LayoutOptions.Start
};
image.SetBinding(Image.SourceProperty, new Binding("ImageUri"));
image.WidthRequest = image.HeightRequest = 40;
var nameLayout = CreateNameLayout();
var viewLayout = new StackLayout()
{
Orientation = StackOrientation.Horizontal,
Children = { image, nameLayout }
};
View = viewLayout;
}
static StackLayout CreateNameLayout()
{
var nameLabel = new Label
{
HorizontalOptions= LayoutOptions.FillAndExpand
};
nameLabel.SetBinding(Label.TextProperty, "DisplayName");
var twitterLabel = new Label
{
HorizontalOptions = LayoutOptions.FillAndExpand,
Font = Fonts.Twitter
};
twitterLabel.SetBinding(Label.TextProperty, "Twitter");
var nameLayout = new StackLayout()
{
HorizontalOptions = LayoutOptions.StartAndExpand,
Orientation = StackOrientation.Vertical,
Children = { nameLabel, twitterLabel }
};
return nameLayout;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.