Tugas 5
Xamarin Profile
Tugas kali ini diminta untuk membuat Xamarin Mobile App dengan menggunakan Visual Studio. Pembuatan aplikasi ini berdasarkan pada link berikut:
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: Pembuatan app dengan Xamarin" HorizontalTextAlignment="Center" TextColor="White" FontSize="36"/> | |
</Frame> | |
<Button Text="Click Me" Clicked="Handle_Clicked" /> | |
<Label Text="Hallo Saya Dicki! Mari belajar bersama!" FontSize="Title" Padding="30,10,30,10"/> | |
<Label Text="Saya Clever Dicki Marpaung mahasiswa Teknik Informatika Institut Teknologi Sepuluh Nopember (ITS) yang menekuni bidang web development dan jaringan. Tertarik pada hal yang berkaitan dengan DevOps." FontSize="16" Padding="30,0,30,0"/> | |
<Label FontSize="16" Padding="30,24,30,0"> | |
<Label.FormattedText> | |
<FormattedString> | |
<FormattedString.Spans> | |
<Span Text="Pelajari lebih lanjut mengenai Xamarin di "/> | |
<Span Text="https://aka.ms/xamarin-quickstart" FontAttributes="Bold"/> | |
</FormattedString.Spans> | |
</FormattedString> | |
</Label.FormattedText> | |
</Label> | |
</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; | |
private void Handle_Clicked(object sender, EventArgs e) | |
{ | |
count++; | |
((Button)sender).Text = $"You clicked {count} times."; | |
} | |
} | |
} |
Comments
Post a Comment