{"id":37575,"date":"2024-11-01T09:58:40","date_gmt":"2024-11-01T09:58:40","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37575"},"modified":"2024-11-01T11:02:11","modified_gmt":"2024-11-01T11:02:11","slug":"uwp-development-basics-of-xaml-programming","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37575\/","title":{"rendered":"UWP Development, Basics of XAML Programming"},"content":{"rendered":"<p>\n    UWP (Universal Windows Platform) is an application platform developed by Microsoft that provides the foundation for developing applications that can run on all devices with Windows 10 and later versions.<br \/>\n    UWP apps allow for the reuse of the same code across various devices, providing users with a consistent experience.\n<\/p>\n<h2>1. Setting Up the UWP Development Environment<\/h2>\n<p>\n    To develop UWP applications, you need to install Visual Studio on a Windows 10 environment.<br \/>\n    Install the latest version of Visual Studio and select the &#8220;Developer workload&#8221; for UWP development.\n<\/p>\n<h3>1.1 Steps to Install Visual Studio<\/h3>\n<ol>\n<li>Visit the Visual Studio website and download the installer.<\/li>\n<li>Run the installation and select &#8220;Universal Windows Platform development&#8221; from the &#8220;Developer workload&#8221;.<\/li>\n<li>Choose the necessary components and complete the installation.<\/li>\n<\/ol>\n<h2>2. Understanding XAML<\/h2>\n<p>\n    XAML (eXtensible Application Markup Language) is a markup language used to design the UI of UWP applications.<br \/>\n    XAML is XML-based and allows for the declarative definition of UI elements.\n<\/p>\n<h3>2.1 Basic Structure of XAML<\/h3>\n<p>\n    A XAML file typically has the following structure:\n<\/p>\n<pre><code>&lt;Page\n    x:Class=\"MyApp.MainPage\"\n    xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n    xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\n    xmlns:local=\"using:MyApp\"\n    xmlns:d=\"http:\/\/schemas.microsoft.com\/expression\/blend\/2008\"\n    xmlns:mc=\"http:\/\/schemas.openxmlformats.org\/markup-compatibility\/2006\"\n    mc:Ignorable=\"d\"&gt;\n\n    &lt;Grid&gt;\n        &lt;TextBlock Text=\"Hello, UWP!\" FontSize=\"24\" \/&gt;\n    &lt;\/Grid&gt;\n&lt;\/Page&gt;<\/code><\/pre>\n<p>\n    The above XAML code defines a basic page and a text block.<br \/>\n    &#8216;Grid&#8217; serves as a container for placing UI elements, while &#8216;TextBlock&#8217; is an element that simply displays text.\n<\/p>\n<h2>3. Basic Components of UWP Applications<\/h2>\n<p>\n    UWP applications consist of various components. Here, we describe the main components: pages, user controls, and resources.\n<\/p>\n<h3>3.1 Page<\/h3>\n<p>\n    Each screen of a UWP application is represented by a page. Each page can be loaded independently and navigated to via a URL.<br \/>\n    Typically, `Frame` is used to handle navigation between pages.\n<\/p>\n<pre><code>Frame.Navigate(typeof(SecondPage));<\/code><\/pre>\n<p>\n    The above code demonstrates how to navigate from the current page to the SecondPage.\n<\/p>\n<h3>3.2 User Control<\/h3>\n<p>\n    User controls are reusable UI elements. In large-scale applications, it is advisable to manage the UI by splitting it into multiple user controls.\n<\/p>\n<pre><code>&lt;UserControl x:Class=\"MyApp.MyUserControl\"\n    xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n    xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;\n\n    &lt;Grid&gt;\n        &lt;TextBlock Text=\"This is a custom control.\" \/&gt;\n    &lt;\/Grid&gt;\n&lt;\/UserControl&gt;<\/code><\/pre>\n<h3>3.3 Resources<\/h3>\n<p>\n    In UWP, you can define resources for commonly used values, styles, or brushes across multiple UI elements.<br \/>\n    Resources can be defined in Application.Resources for global access.\n<\/p>\n<pre><code>&lt;Application.Resources&gt;\n    &lt;SolidColorBrush x:Key=\"PrimaryColor\" Color=\"Blue\"\/&gt;\n&lt;\/Application.Resources&gt;<\/code><\/pre>\n<h2>4. Events and Data Binding<\/h2>\n<p>\n    In XAML, you can connect UI elements with events and dynamically update the UI based on data.\n<\/p>\n<h3>4.1 Event Handling<\/h3>\n<pre><code>&lt;Button Content=\"Click Me\" Click=\"Button_Click\"\/&gt;<\/code><\/pre>\n<p>\n    This is how you can handle a button click event.\n<\/p>\n<pre><code>private void Button_Click(object sender, RoutedEventArgs e)\n{\n    \/\/ Event handling code\n}<\/code><\/pre>\n<h3>4.2 Data Binding<\/h3>\n<p>\n    Data binding allows you to easily synchronize between the UI and the data model.<br \/>\n    You can set the data context in the XAML line and bind to the properties of the UI elements.\n<\/p>\n<pre><code>&lt;TextBlock Text=\"{Binding Name}\"\/&gt;<\/code><\/pre>\n<p>\n    The above code defines a TextBlock that is bound to the &#8216;Name&#8217; property.<br \/>\n    Here\u2019s how to set the data context.\n<\/p>\n<pre><code>this.DataContext = this;<\/code><\/pre>\n<h2>5. Deployment of UWP Apps<\/h2>\n<p>\n    After developing a UWP application, you can deploy it to the Microsoft Store.<br \/>\n    To deploy, you must create an app package and submit it for review by the deadline.\n<\/p>\n<h3>5.1 Creating an App Package<\/h3>\n<p>\n    Package creation can be done through the &#8220;Project&#8221; &gt; &#8220;Create App Package&#8221; menu in Visual Studio.<br \/>\n    Select the platform for deployment (Windows 10, ARM, etc.) and follow the step-by-step instructions to create the package.\n<\/p>\n<h3>5.2 Submitting to Microsoft Store<\/h3>\n<p>\n    After creating the package, you must submit the application through the Microsoft Partner Center and undergo a review.<br \/>\n    During submission, you need to provide the app&#8217;s screenshots, description, and other metadata.\n<\/p>\n<h2>Conclusion<\/h2>\n<p>\n    We covered the basic understanding of UWP development and XAML. UWP offers many advantages for developing efficient and effective applications.<br \/>\n    The structure of XAML, event handling, data binding, and other elements are essential for UWP development.<br \/>\n    Based on the content introduced in this course, try your hand at developing full-fledged UWP applications.\n<\/p>\n<h2>Sample Code<\/h2>\n<p>\n    Below is a complete code example of a simple UWP application.\n<\/p>\n<pre><code>&lt;Page\n    x:Class=\"MyApp.MainPage\"\n    xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\n    xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;\n\n    &lt;Grid&gt;\n        &lt;TextBlock Text=\"{Binding Greeting}\" FontSize=\"24\" \/&gt;\n        &lt;Button Content=\"Click Me\" Click=\"Button_Click\" \/&gt;\n    &lt;\/Grid&gt;\n&lt;\/Page&gt;<\/code><\/pre>\n<pre><code>public sealed partial class MainPage : Page\n{\n    public string Greeting { get; set; } = \"Hello, UWP!\";\n\n    public MainPage()\n    {\n        this.InitializeComponent();\n        this.DataContext = this;\n    }\n\n    private void Button_Click(object sender, RoutedEventArgs e)\n    {\n        Greeting = \"Button Clicked!\";\n        OnPropertyChanged(nameof(Greeting));\n    }\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>UWP (Universal Windows Platform) is an application platform developed by Microsoft that provides the foundation for developing applications that can run on all devices with Windows 10 and later versions. UWP apps allow for the reuse of the same code across various devices, providing users with a consistent experience. 1. Setting Up the UWP Development &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37575\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;UWP Development, Basics of XAML Programming&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[115],"tags":[],"class_list":["post-37575","post","type-post","status-publish","format-standard","hentry","category-uwp-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>UWP Development, Basics of XAML Programming - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/37575\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UWP Development, Basics of XAML Programming - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"UWP (Universal Windows Platform) is an application platform developed by Microsoft that provides the foundation for developing applications that can run on all devices with Windows 10 and later versions. UWP apps allow for the reuse of the same code across various devices, providing users with a consistent experience. 1. Setting Up the UWP Development &hellip; \ub354 \ubcf4\uae30 &quot;UWP Development, Basics of XAML Programming&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37575\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:58:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:02:11+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/37575\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37575\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"UWP Development, Basics of XAML Programming\",\"datePublished\":\"2024-11-01T09:58:40+00:00\",\"dateModified\":\"2024-11-01T11:02:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37575\/\"},\"wordCount\":580,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"UWP Programming\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37575\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37575\/\",\"name\":\"UWP Development, Basics of XAML Programming - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:58:40+00:00\",\"dateModified\":\"2024-11-01T11:02:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37575\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37575\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37575\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UWP Development, Basics of XAML Programming\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"UWP Development, Basics of XAML Programming - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/37575\/","og_locale":"ko_KR","og_type":"article","og_title":"UWP Development, Basics of XAML Programming - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"UWP (Universal Windows Platform) is an application platform developed by Microsoft that provides the foundation for developing applications that can run on all devices with Windows 10 and later versions. UWP apps allow for the reuse of the same code across various devices, providing users with a consistent experience. 1. Setting Up the UWP Development &hellip; \ub354 \ubcf4\uae30 \"UWP Development, Basics of XAML Programming\"","og_url":"https:\/\/atmokpo.com\/w\/37575\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:58:40+00:00","article_modified_time":"2024-11-01T11:02:11+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"4\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/37575\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37575\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"UWP Development, Basics of XAML Programming","datePublished":"2024-11-01T09:58:40+00:00","dateModified":"2024-11-01T11:02:11+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37575\/"},"wordCount":580,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["UWP Programming"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37575\/","url":"https:\/\/atmokpo.com\/w\/37575\/","name":"UWP Development, Basics of XAML Programming - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:58:40+00:00","dateModified":"2024-11-01T11:02:11+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37575\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37575\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37575\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"UWP Development, Basics of XAML Programming"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=37575"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37575\/revisions"}],"predecessor-version":[{"id":37576,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37575\/revisions\/37576"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}