{"id":37559,"date":"2024-11-01T09:58:33","date_gmt":"2024-11-01T09:58:33","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37559"},"modified":"2024-11-01T11:02:14","modified_gmt":"2024-11-01T11:02:14","slug":"uwp-development-uwp-program-examples","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37559\/","title":{"rendered":"UWP Development, UWP Program Examples"},"content":{"rendered":"<p><body><\/p>\n<p>UWP (Universal Windows Platform) is a platform for developing applications that can run on various Windows 10 devices. This allows developers to create apps that run on PCs, tablets, Xbox, IoT devices, and more. UWP is Microsoft&#8217;s new app model, providing a modern user interface (UI) and flexible application structure.<\/p>\n<h2>Setting Up the UWP Development Environment<\/h2>\n<p>To develop UWP applications, the following environment is required:<\/p>\n<ul>\n<li>Windows 10 operating system<\/li>\n<li>Visual Studio 2019 or later<\/li>\n<li>Windows SDK<\/li>\n<\/ul>\n<p>After installing Visual Studio, select the &#8216;UWP Development&#8217; workload to install it.<\/p>\n<h2>UWP Application Structure<\/h2>\n<p>UWP applications are fundamentally composed of the following files:<\/p>\n<ul>\n<li><strong>App.xaml<\/strong>: Defines the application&#8217;s resources and startup page.<\/li>\n<li><strong>MainPage.xaml<\/strong>: The page where the user interface (UI) is defined.<\/li>\n<li><strong>Package.appxmanifest<\/strong>: A file that sets the application&#8217;s metadata and permissions.<\/li>\n<\/ul>\n<h2>Creating Your First UWP Application<\/h2>\n<p>Let&#8217;s create a simple UWP application following the steps below.<\/p>\n<ol>\n<li>Run Visual Studio and select &#8216;Create a New Project&#8217;.<\/li>\n<li>Select &#8216;Blank App&#8217; from the UWP category, enter the project name, and click &#8216;Create&#8217;.<\/li>\n<\/ol>\n<h3>Code Structure<\/h3>\n<p>Once the project is created, the App.xaml and MainPage.xaml files will be generated. Below is an example of MainPage.xaml:<\/p>\n<pre><code class=\"language-xml\">\n&lt;Page\n    x:Class=\"YourAppNamespace.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:YourAppNamespace\"\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 Background=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\"&gt;\n        &lt;TextBlock x:Name=\"textBlock\" Text=\"Hello, UWP!\" FontSize=\"24\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"\/&gt;\n        &lt;Button Content=\"Click Me\" Click=\"Button_Click\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Bottom\" Margin=\"0,50,0,0\"\/&gt;\n    &lt;\/Grid&gt;\n&lt;\/Page&gt;\n<\/code><\/pre>\n<p>In the code above, we added simple text and a button. Now, let&#8217;s handle the button click event in the MainPage.xaml.cs file.<\/p>\n<pre><code class=\"language-csharp\">\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\n\nnamespace YourAppNamespace\n{\n    public sealed partial class MainPage : Page\n    {\n        public MainPage()\n        {\n            this.InitializeComponent();\n        }\n\n        private void Button_Click(object sender, RoutedEventArgs e)\n        {\n            textBlock.Text = \"Button has been clicked!\";\n        }\n    }\n}\n<\/code><\/pre>\n<h2>Data Binding in UWP<\/h2>\n<p>In UWP applications, data binding can be implemented through the MVVM (Model-View-ViewModel) pattern. Data binding automatically maintains the connection between UI elements and data models. The example below introduces data binding using XAML and C#.<\/p>\n<h3>Creating the Model<\/h3>\n<pre><code class=\"language-csharp\">\npublic class Person\n{\n    public string Name { get; set; }\n    public int Age { get; set; }\n}\n<\/code><\/pre>\n<h3>Creating the ViewModel<\/h3>\n<pre><code class=\"language-csharp\">\nusing System.ComponentModel;\n\npublic class PersonViewModel : INotifyPropertyChanged\n{\n    private Person person;\n\n    public PersonViewModel()\n    {\n        person = new Person() { Name = \"John Doe\", Age = 30 };\n    }\n\n    public string Name\n    {\n        get => person.Name;\n        set\n        {\n            person.Name = value;\n            OnPropertyChanged(nameof(Name));\n        }\n    }\n\n    public int Age\n    {\n        get => person.Age;\n        set\n        {\n            person.Age = value;\n            OnPropertyChanged(nameof(Age));\n        }\n    }\n\n    public event PropertyChangedEventHandler PropertyChanged;\n\n    protected void OnPropertyChanged(string propertyName)\n    {\n        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n    }\n}\n<\/code><\/pre>\n<h3>Applying Binding in XAML<\/h3>\n<pre><code class=\"language-xml\">\n&lt;Page\n    x:Class=\"YourAppNamespace.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:YourAppNamespace\"&gt;\n\n    &lt;Grid&gt;\n        &lt;TextBlock Text=\"{Binding Name}\" FontSize=\"24\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"\/&gt;\n        &lt;TextBox Text=\"{Binding Age, Mode=TwoWay}\" Width=\"200\" HorizontalAlignment=\"Center\" VerticalAlignment=\"Bottom\"\/&gt;\n    &lt;\/Grid&gt;\n&lt;\/Page&gt;\n<\/code><\/pre>\n<p>The above code binds the Name property directly to the text block and binds the Age property to the text box in a two-way fashion. By setting the ViewModel as the data context of the page, the UI will be automatically updated with the data.<\/p>\n<h2>Deploying UWP Apps<\/h2>\n<p>There are several ways to deploy UWP applications:<\/p>\n<ul>\n<li>Windows Store: You can submit the app to the Microsoft Store for a wider audience.<\/li>\n<li>Direct Deployment: You can create an .appx package and distribute it directly to users.<\/li>\n<li>Local Testing: You can run the app in a development environment.<\/li>\n<\/ul>\n<h2>Conclusion<\/h2>\n<p>UWP development is a great way to create flexible and intuitive applications that can run on various Windows devices. Through this tutorial, you have learned the basics of UWP development and hopefully created a simple application. You can learn more in-depth content through the official documentation or various communities.<\/p>\n<h2>References<\/h2>\n<ul>\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/uwp\/get-started\/\" target=\"_blank\" rel=\"noopener\">Microsoft Official UWP Getting Started Documentation<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/design\/\" target=\"_blank\" rel=\"noopener\">UWP Design Guidelines<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/csharp\/\" target=\"_blank\" rel=\"noopener\">UWP C# Development Documentation<\/a><\/li>\n<\/ul>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>UWP (Universal Windows Platform) is a platform for developing applications that can run on various Windows 10 devices. This allows developers to create apps that run on PCs, tablets, Xbox, IoT devices, and more. UWP is Microsoft&#8217;s new app model, providing a modern user interface (UI) and flexible application structure. Setting Up the UWP Development &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37559\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;UWP Development, UWP Program Examples&#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-37559","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, UWP Program Examples - \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\/37559\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UWP Development, UWP Program Examples - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"UWP (Universal Windows Platform) is a platform for developing applications that can run on various Windows 10 devices. This allows developers to create apps that run on PCs, tablets, Xbox, IoT devices, and more. UWP is Microsoft&#8217;s new app model, providing a modern user interface (UI) and flexible application structure. Setting Up the UWP Development &hellip; \ub354 \ubcf4\uae30 &quot;UWP Development, UWP Program Examples&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37559\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:58:33+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:02:14+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=\"3\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/37559\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37559\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"UWP Development, UWP Program Examples\",\"datePublished\":\"2024-11-01T09:58:33+00:00\",\"dateModified\":\"2024-11-01T11:02:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37559\/\"},\"wordCount\":433,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"UWP Programming\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37559\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37559\/\",\"name\":\"UWP Development, UWP Program Examples - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:58:33+00:00\",\"dateModified\":\"2024-11-01T11:02:14+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37559\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37559\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37559\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UWP Development, UWP Program Examples\"}]},{\"@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, UWP Program Examples - \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\/37559\/","og_locale":"ko_KR","og_type":"article","og_title":"UWP Development, UWP Program Examples - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"UWP (Universal Windows Platform) is a platform for developing applications that can run on various Windows 10 devices. This allows developers to create apps that run on PCs, tablets, Xbox, IoT devices, and more. UWP is Microsoft&#8217;s new app model, providing a modern user interface (UI) and flexible application structure. Setting Up the UWP Development &hellip; \ub354 \ubcf4\uae30 \"UWP Development, UWP Program Examples\"","og_url":"https:\/\/atmokpo.com\/w\/37559\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:58:33+00:00","article_modified_time":"2024-11-01T11:02:14+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":"3\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/37559\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37559\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"UWP Development, UWP Program Examples","datePublished":"2024-11-01T09:58:33+00:00","dateModified":"2024-11-01T11:02:14+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37559\/"},"wordCount":433,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["UWP Programming"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37559\/","url":"https:\/\/atmokpo.com\/w\/37559\/","name":"UWP Development, UWP Program Examples - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:58:33+00:00","dateModified":"2024-11-01T11:02:14+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37559\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37559\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37559\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"UWP Development, UWP Program Examples"}]},{"@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\/37559","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=37559"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37559\/revisions"}],"predecessor-version":[{"id":37560,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37559\/revisions\/37560"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37559"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37559"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37559"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}