Tugas 5 Xamarin APP
Xamarin APP
Pada kesempatan kali ini kita diminta untuk membuat Xamarin Mobile APP dengan menggunakan Visual Studio.
Tampilan Aplikasi
Source Code:
MainPage.xaml:
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
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
x:Class="AwesomeApp.MainPage"> | |
<StackLayout> | |
<Frame BackgroundColor="DeepPink" Padding="24" CornerRadius="0"> | |
<Label Text="Tugas 5: Membuat Mobile App dengan Xamarin" HorizontalTextAlignment="Center" TextColor="White" FontSize="36"/> | |
</Frame> | |
<Button Text="Click Me" Clicked="Handle_Clicked"/> | |
<Label Text="Hallo, My name Herri Purba" FontSize="Title" Padding="30,10,30,10"/> | |
</StackLayout> | |
</ContentPage> |
MainPage.xaml.cs:
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 System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
namespace AwesomeApp | |
{ | |
public partial class MainPage : ContentPage | |
{ | |
public MainPage() | |
{ | |
InitializeComponent(); | |
} | |
int count = 0; | |
void Handle_Clicked(object sender, System.EventArgs e) | |
{ | |
count++; | |
((Button)sender).Text = $"You clicked {count} times."; | |
} | |
} | |
} |
Komentar
Posting Komentar