Assalamu’alaikum
..
Selamat
datang pertemuan ke 10.
Selamat
tinggal UTS~ wkwk.
Welcome
Navigation Page.
Iyaa
pertemuan 10 ini pembahasan video tutorial tentang Navigation Page.
Daaaaaaaaaan keyword kali ini adalah … jeng jeng jeng *pake backsound donq* :3
keywordnya adalah apa alasan anda kuliah di TEDC ?? aku langsung netapin
jawaban, jawaban aku adalah masuk TEDC karena Beasiswa. Ehhh baru juga mikir
begitu sang dosen dengan ga kalah cepatnya langsung ngomong “jawabannya selain
Beasiswa yaaaaa, kan pasti ada alasan lain selain Beasiswa” aihh si dosen teh
mendadak bikin aku harus muter otak lagi buat nyari jawaban lain~ wkwk. Selagi
nunggu giliran nama aku di panggil, aku berusaha mikir mikir mikir mikir mikir
mikir dan mikir jawaban yang pas. Karena jawaban standarnya rata-rata udah pada
di sebutin teman-teman BUD4TI. Hemm hemmm hemmmm iyaa aku kuliah TEDC ini kan
karena beasiswa, beasiswa BPKLN, karena berhasil lolos LKS SMK Tingkat
Nasional. Yaudin pake jawaban itu ajj~ yaaa emang itu jawabannyaa helehhh.
“Berawal
dari LKS SMK pak …” jawab aku.
“Ohh
LKS SMK yaa”
“Iyaaa
pak”
“Bidang
apa fi ??”
“Animasi
pak”
Begituuuuu
:D dan sang dosen angguk-angguk hheheh.
Okeokeoke
lanjut pembahasan tentang Navigation Page. Pembahasan ini agar kita mengetahui bagaimana membuat
halaman lebih dari satu atau berpindah halaman dan bisa saling bertukar nilai
antar halaman.
Buka aplikasi windows phone – new project – name dan solution name
(NavigationPage) Kemudian Pilih platform Windows Phone 7.1.
Buat Folder untuk menyimpan halaman baru yg akan kita buat
> Klik kanan pada Project– Add- New Folder (Views)
Buat 5 halaman baru >
Klik kanan pada Folder Views – Add - New Item
MainPage (default)
SecondPage
ThirdPage
FourthPage
FifthPage
Elemen yang di gunakan
di MainPage :
TextBox
Name="mainTBx"
Text=""
Name="mainTBx"
Text=""
TextBlock
Name="mainTBl"
Text=""
Button1
Name="page2"
Name="page2"
Content="SecondPage"
Button2
Name="page3"
Content="ThirdPage”
Button3
Name="page4"
Content="FourthPage”
Button4
Name="page5"
Name="page5"
Content="FifthPage”
MainPage.xaml.cs
:
// mengirimkan data di textbox ke
halaman Uri
private void page2_Click(object sender, RoutedEventArgs e)
private void page2_Click(object sender, RoutedEventArgs e)
{
string name
= mainTBx.Text;
NavigationService.Navigate(new Uri("/Views/SecondPage.xaml?name=" +
name, UriKind.Relative));
}
// menerima data yang dikirimkan,dan
format a seperti apa
protected override voidOnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
protected override voidOnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
string name
= "";
if (NavigationContext.QueryString.TryGetValue("name", outname))
{
mainTBl.Text
= string.Format("{0}", name);
}
}
private void page3_Click(object sender, RoutedEventArgs e)
{
string name
= mainTBx.Text;
NavigationService.Navigate(new Uri("/Views/ThirdPage.xaml?name=" +
name, UriKind.Relative));
}
private void page4_Click(object sender, RoutedEventArgs e)
{
string name
= mainTBx.Text;
NavigationService.Navigate(new Uri("/Views/FourthPage.xaml?name=" +
name, UriKind.Relative));
}
private void page5_Click(object sender, RoutedEventArgs e)
{
string name
= mainTBx.Text;
NavigationService.Navigate(new Uri("/Views/FifthPage.xaml?name=" +
name, UriKind.Relative));
}
Elemen yang di gunakan
di SecondPage :
TextBox
Name="secondTBx"
Text=""
Name="secondTBx"
Text=""
TextBlock
Name="secondTBl"
Text=""
Button1
Name="mainpage"
Name="mainpage"
Content="MainPage"
Button2
Name="page3"
Content="ThirdPage”
Button3
Name="page4"
Content="FourthPage”
Button4
Name="page5"
Name="page5"
Content="FifthPage”
SecondPage.xaml.cs
:
protected override voidOnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
string name
= "";
if (NavigationContext.QueryString.TryGetValue("name", outname))
{
secondTBl.Text
= string.Format("{0}", name);
}
}
private void mainpage_Click(object sender, RoutedEventArgs e)
{
string name
= secondTBx.Text;
NavigationService.Navigate(new Uri("/MainPage.xaml?name=" +
name, UriKind.Relative));
}
private void page3_Click(object sender, RoutedEventArgs e)
{
string name
= secondTBx.Text;
NavigationService.Navigate(new Uri("/Views/ThirdPage.xaml?name=" +
name, UriKind.Relative));
}
private void page4_Click(object sender, RoutedEventArgs e)
{
string name
= secondTBx.Text;
NavigationService.Navigate(new Uri("/Views/FourthPage.xaml?name=" +
name, UriKind.Relative));
}
private void page5_Click(object sender, RoutedEventArgs e)
{
string name
= secondTBx.Text;
NavigationService.Navigate(new Uri("/Views/FifthPage.xaml?name=" +
name, UriKind.Relative));
}
Elemen yang di gunakan
di ThirdPage :
TextBox
Name="thirdTBx"
Text=""
Name="thirdTBx"
Text=""
TextBlock
Name="thirdTBl"
Text=""
Button1
Name="mainpage"
Name="mainpage"
Content="MainPage"
Button2
Name="page2"
Content="SecondPage”
Button3
Name="page4"
Content="FourthPage”
Button4
Name="page5"
Name="page5"
Content="FifthPage”
ThirdPage.xaml.cs
:
protected override voidOnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
string name
= "";
if (NavigationContext.QueryString.TryGetValue("name", outname))
{
thirdTBl.Text = string.Format("{0}", name);
}
}
private void mainpage_Click(object sender, RoutedEventArgs e)
{
string name
= thirdTBx.Text;
NavigationService.Navigate(new Uri("/MainPage.xaml?name=" +
name, UriKind.Relative));
}
private void page2_Click(object sender, RoutedEventArgs e)
{
string name = thirdTBx.Text;
NavigationService.Navigate(new Uri("/Views/SecondPage.xaml?name=" +
name, UriKind.Relative));
}
private void page4_Click(object sender, RoutedEventArgs e)
{
string name
= thirdTBx.Text;
NavigationService.Navigate(new Uri("/Views/FourthPage.xaml?name=" +
name, UriKind.Relative));
}
private void page5_Click(object sender, RoutedEventArgs e)
{
string name
= thirdTBx.Text;
NavigationService.Navigate(new Uri("/Views/FifthPage.xaml?name=" +
name, UriKind.Relative));
}
Elemen yang di gunakan
di FourthPage :
TextBox
Name="fourthTBx"
Text=""
Name="fourthTBx"
Text=""
TextBlock
Name="fourthTBl"
Text=""
Button1
Name="mainpage"
Name="mainpage"
Content="MainPage"
Button2
Name="page3"
Content="ThirdPage”
Button3
Name="page4"
Content="FourthPage”
Button4
Name="page5"
Name="page5"
Content="FifthPage”
FourthPage.xaml.cs :
protected override voidOnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
string name
= "";
if (NavigationContext.QueryString.TryGetValue("name", outname))
{
fourthTBl.Text = string.Format("{0}", name);
}
}
private void mainpage_Click(object sender, RoutedEventArgs e)
{
string name
= fourthTBx.Text;
NavigationService.Navigate(new Uri("/MainPage.xaml?name=" +
name, UriKind.Relative));
}
private void page2_Click(object sender, RoutedEventArgs e)
{
string name
= fourthTBx.Text;
NavigationService.Navigate(new Uri("/Views/SecondPage.xaml?name=" +
name, UriKind.Relative));
}
private void page3_Click(object sender, RoutedEventArgs e)
{
string name
= fourthTBx.Text;
NavigationService.Navigate(new Uri("/Views/ThirdPage.xaml?name=" +
name, UriKind.Relative));
}
private void page5_Click(object sender, RoutedEventArgs e)
{
string name
= fourthTBx.Text;
NavigationService.Navigate(new Uri("/Views/FifthPage.xaml?name=" +
name, UriKind.Relative));
}
Elemen yang di gunakan
di FifthPage :
TextBox
Name="fifthTBx"
Text=""
Name="fifthTBx"
Text=""
TextBlock
Name="fifthTBl"
Text=""
Button1
Name="mainpage"
Name="mainpage"
Content="MainPage"
Button2
Name="page2"
Content="SecondPage”
Button3
Name="page3"
Content="ThirdPage"
Button4
Name="page4"
Name="page4"
Content="FourthPage"
FifthPage.xaml.cs
:
protected override voidOnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
string name
= "";
if (NavigationContext.QueryString.TryGetValue("name", outname))
{
fifthTBl.Text = string.Format("{0}", name);
}
}
private void mainpage_Click(object sender, RoutedEventArgs e)
{
string name
= fifthTBx.Text;
NavigationService.Navigate(new Uri("/MainPage.xaml?name=" +
name, UriKind.Relative));
}
private void page2_Click(object sender, RoutedEventArgs e)
{
string name
= fifthTBx.Text;
NavigationService.Navigate(new Uri("/Views/SecondPage.xaml?name=" +
name, UriKind.Relative));
}
private void page3_Click(object sender, RoutedEventArgs e)
{
string name
= fifthTBx.Text;
NavigationService.Navigate(new Uri("/Views/ThirdPage.xaml?name=" +
name, UriKind.Relative));
}
private void page4_Click(object sender, RoutedEventArgs e)
{
string name
= fifthTBx.Text;
NavigationService.Navigate(new Uri("/Views/FourthPage.xaml?name=" +
name, UriKind.Relative));
}
Cukup
sekian laporan postingan pertemuan 10 inii ..
Mohon
maaf postingan kali ini tidak menampilkan gambar, tapi insyAllah di lain
kesempatan akan segera di sisipkan gambar kok hhehe.
Saat
sedang mengerjakan ini aku sedang dalam suasana berduka. Alm bapak meninggal
hari minggu kemarin karena sakit. Mohon doanya yaa dari teman-teman yang
membaca postingan ini J
Buat bapak dosen yang kalo emang sedang nge-Blog malam ini *ngecek laporan kami
:D, jumat besok saya izin ga bisa hadir matkul bapak karena sedang di
Lhokseumawe dan baru balik lagi insyAllah hari minggu nya *eitsss malah minta
izin disinii :x wkwk* ntar lebih lengkapnya saya serahkan ke teman-teman BUD4TI
:D :D
Sempat
ga bisa mikir dan ga bisa ngerjain apa-apa, tapi Alhamdulillah diberi kemudahan
dan pencerahan hhaha dan video tutorial pertemuan kali ini berhasil di posting
:D
Semoga
postingan ini bermanfaat dan semoga berhasil~
Terima
kasih~
Wassalamu’alaikum
wr.wb
0 komentar:
Posting Komentar