Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Windows Store Apps > Windows Store and Controls (C#) > โครงสร้างของ Project บน Windows Store Apps และไฟล์ต่าง ๆ ที่เกี่ยวข้อง (C#)



Clound SSD Virtual Server

โครงสร้างของ Project บน Windows Store Apps และไฟล์ต่าง ๆ ที่เกี่ยวข้อง (C#)

โครงสร้างของ Project บน Windows Store Apps และไฟล์ต่าง ๆ ที่เกี่ยวข้อง (C#) บทความก่อนหน้านี้เราได้เรียนรู้วิธีการสร้าง Project ในรูปแบบต่าง ๆ จาก Project Template แล้ว ในหัวข้อที่สอง นี้ เราจะทำความรู้จักกับไฟล์ต่าง ๆ ที่เราได้จากการสร้าง Project ของ Windows Store Apps ด้วยภาษา C# โดยไฟล์ต่าง ๆ ที่เหล่านี้จะมาพร้อมกับ Template ที่เป็น Blank Apps หรือ Template ในรูปแบบอื่น ๆ แต่พื้นฐานแล้ว ไฟล์หลัก ๆ ยังคงจะเหมือนกัน และไม่แตกต่างกันทั้ง Visual Studio 2012 และ Visual Studio 2013

หลังจากสร้างโปรเจคแล้ว เราจะได้ Solution Explorer ของ Project ดังรูป

Project บน Windows Store

คำอธิบายเกี่ยวกับไฟล์ต่าง ๆ

  • Properties -> Assemblyinfo.cs
  • ไฟล์นี้เหมือนกับ .Net Application อื่น ๆ คือ ใช้เก็บ Version ของ Apps หรือพวก Title และ รายละเอียดต่าง ๆ ของ Application

  • References
  • อันนี้เป็นกรายการ References ของ Package และ Library ต่าง ๆ ที่เรา Include เข้ามาใช้งานใน Project








  • Assets
  • สำหรับโฟเดอร์นี้เป็นโฟเดอร์ค่า Default ที่โปรแกรมมีมาให้ ซึ่งจะใช้จัดเก็บพวก Image และ Icons ที่จะไปใช้บน Project ของเรา เช่น Logo ของ Apps แสดงบน Start Screen หรือ SplashScreen แสดงตอน Loading หรือ StoreLogo ใช้แสดงตอน เวลาเลือกแอพเพื่อที่จะ install ลงเครื่อง โดยที่ไฟล์เหล่านี้สามารถแก้ไขผ่าน GUI ของ Package.appxmanifest ได้เช่นเดียวกัน

  • Common -> StandardStyles.xaml
  • เป็นไฟล์เก็บพวกค่า Default ของ XAML Styles ที่ใช้ในแอพเช่น text boxes, radio buttons, หรือ application bar icons ซึ่งเราสามารถเรียกใช้งานมันได้ทันที

  • App.xaml
  • ไฟล์นี้คือว่าสำคัญมาก เพราะเป็นไฟล์แรกที่จะถูกเรียกทำงาน เมื่อโปรแกรมมีการโหลดขึ้น ถ้าบน ASP.Net ก็คงจะหมายถึง Global.aspx ซึ่งเหมาะจะกำหนดพวกค่าเริ่มต้นต่าง ๆ ที่จะใช้กับทุก ๆ ส่วนของ Application

  • App.xaml.cs
  • ไฟล์นี้จะเหมือนกับ Global.aspx.cs คือจะเป็นส่วนของ C# ที่กำหนดการเริ่มต้นการทำงาน ซึ่งอาจจะเป็นพวก Method ของ OnLaunched(), OnSuspending() ซึ่งจะเป็นการระบุทิศทางการทำงานของ Apps ว่าหลังจากนี้จะให้เรียกไฟล์หรือ Page ใดขึ้นมาทำงาน

  • MainPage.xaml
  • เป็น Page สำหรับการสร้างหน้าจอ UI ไว้แสดงผลการทำงาน ซึ่งจะถูกออกแบบด้วย Control ต่าง ๆ โดยใช้ภาษา XAML เป็ฯตัวควบคุมการทำงานของ Interface

  • MainPage.xaml.cs
  • เป็น Code Behind ของภาษา C# ควบคุมการทำงานของ Control ต่าง ๆ ที่อยู่บนไฟล์ MainPage.xaml

  • Package.appxmanifest
  • เป็นไฟล์สำหรับจัดเก็บค่า Config หรือค่าติดตั้งต่าง ๆ ของ Apps เช่น ต้องการให้ Apps รองรับการทำงานพวก Search, location, หรือ webcam ก็สามารถกำหนดค่าได้ที่ไฟล์นี้ โดยสามารถกำหนดค่าในรูปแบบของ GUI ได้ (ดูได้จากท้ายของบทความ)

  • WindowsStoreApps_TemporaryKey.pfx
  • เป็นไฟล์ Certificate ที่จะใช้บน Store ของ Windows Store Apps ซึ่งทุก ๆ Apps จำเป็นจะต้องมี และตัวนี้เป็นเหมือน Temporary Key ที่จะนำไปใช้เมื่อต้องการนำ Apps ขึ้นไปใช้งานบน Store

  • packages.config
  • เป็นรายการ Package หรือ Library ที่ถูก Include เข้ามาใน Project เช่น
    <?xml version="1.0" encoding="utf-8"?>
    <packages>
      <package id="MyToolkit" version="2.0.14.0" targetFramework="win81" />
      <package id="MyToolkit.Extended" version="2.0.14.0" targetFramework="win81" />
    </packages>
    



Package.appxmanifest กำหนดค่าต่าง ๆ บนไฟล์ Package.appxmanifest แบบ GUI ได้จากหน้าจอนี้

Project บน Windows Store







.

   
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2014-03-02 10:35:52 / 2017-03-19 14:47:01
  Download : No files
 Sponsored Links / Related

 
Windows Store Apps กับ Template เช่น Blank , Grid , Hub , Split Apps (C#)
Rating :

 
Page และ Controls หรือ Toolbox เครื่องมือสำหรับออกแบบ UI บน XAML (C#)
Rating :

 
รู้จัก Toolbox และ Controls พื้นฐานเช่น TextBlock , TextBox และ Button (C#)
Rating :

 
AppBar : TopAppBar / BottomAppBar บน Windows Store Apps (C#)
Rating :

 
ListBox แสดงข้อมูลแบบ List และ Combobox บน Windows Store (C#)
Rating :

 
ListView และ GridView บน Windows Store Apps (C#)
Rating :

 
FlipView สร้าง Image FlipView / Image Slide บน Windows Store Apps (C#)
Rating :

 
เล่นไฟล์ Media / Sound เช่น Video Clip / Sound ด้วย MediaElement (C#)
Rating :

 
WebView แสดงผล URL เว็บไซต์ หรือ HTML บน Windows Store Apps (C#)
Rating :

 
เล่นไฟล์ยูทูป บน Windows Store Apps ด้วย MediaElement (C#)
Rating :

 
File Pickers กับ Save Dialog / Open Dialog บน Windows Store Apps (C#)
Rating :

 
Context Menus and Popup Menu บน Windows Store Apps (C#)
Rating :

 
Geolocation and Location หาตำแหน่งของ Client ที่ใช้งาน Apps ของเรา (C#)
Rating :

 
Windows Store App และ Progress Bar การสร้าง Progress Bar (C#)
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่