{"id":37525,"date":"2024-11-01T09:58:16","date_gmt":"2024-11-01T09:58:16","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37525"},"modified":"2024-11-01T11:02:23","modified_gmt":"2024-11-01T11:02:23","slug":"uwp-development-style","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37525\/","title":{"rendered":"UWP Development, Style"},"content":{"rendered":"<p><body><\/p>\n<article>\n<header>\n<p>This article covers how to set styles in Universal Windows Platform (UWP) development on Windows, introducing the importance and application of styling through practical example code.<\/p>\n<\/header>\n<section id=\"introduction\">\n<h2>1. Introduction<\/h2>\n<p>UWP is a platform that allows the development of modern apps that run on various Windows 10 devices. UWP apps can apply various styles to provide users with a rich experience. This article will explain the basic concepts of styles, usage of styles in XAML, resource management, and advanced techniques related to styles.<\/p>\n<\/section>\n<section id=\"styles-basics\">\n<h2>2. Basic Concepts of Styles<\/h2>\n<p>Styles are a powerful feature that helps to apply a consistent visual to UI elements in UWP apps. By using styles, you can easily set common properties across multiple UI elements, which increases code reusability and reduces maintenance effort.<\/p>\n<p>Styles are defined within XAML files using the <code>Style<\/code> element. An example of a basic style is as follows:<\/p>\n<pre><code lang=\"xml\">\n            &lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\" \n                xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;\n                &lt;Style TargetType=\"Button\"&gt;\n                    &lt;Setter Property=\"Background\" Value=\"LightBlue\" \/&gt;\n                    &lt;Setter Property=\"Foreground\" Value=\"White\" \/&gt;\n                    &lt;Setter Property=\"FontSize\" Value=\"16\" \/&gt;\n                    &lt;Setter Property=\"Padding\" Value=\"10\" \/&gt;\n                &lt;\/Style&gt;\n            &lt;\/ResourceDictionary&gt;\n            <\/code><\/pre>\n<\/section>\n<section id=\"using-styles\">\n<h2>3. Applying Styles<\/h2>\n<p>Applying the defined style to UI elements is very simple. To apply a style, specify the desired style in the <code>Style<\/code> property of the respective UI element. The example below shows how to apply a style to a button:<\/p>\n<pre><code lang=\"xml\">\n            &lt;Button Content=\"Click Here\" Style=\"{StaticResource MyButtonStyle}\"\/&gt;\n            <\/code><\/pre>\n<p>Here, <code>MyButtonStyle<\/code> is the key of the style defined above. The <code>StaticResource<\/code> markup extension is used to statically reference the resource.<\/p>\n<\/section>\n<section id=\"typography\">\n<h2>4. Typography and Color<\/h2>\n<p>In UWP apps, typography and color are also important elements of style settings. By adjusting various font styles and background colors, you can enhance the user experience.<\/p>\n<p>For example, an example of applying typography style is as follows:<\/p>\n<pre><code lang=\"xml\">\n            &lt;Style TargetType=\"TextBlock\"&gt;\n                &lt;Setter Property=\"FontFamily\" Value=\"Segoe UI\" \/&gt;\n                &lt;Setter Property=\"FontSize\" Value=\"20\" \/&gt;\n                &lt;Setter Property=\"Foreground\" Value=\"Black\" \/&gt;\n            &lt;\/Style&gt;\n            <\/code><\/pre>\n<\/section>\n<section id=\"advanced-styling\">\n<h2>5. Advanced Styling Techniques<\/h2>\n<p>Using advanced techniques in UWP styling is suitable for building complex UIs. Here, we will describe advanced techniques including triggers, data binding, and animations.<\/p>\n<h3>5.1 Using Triggers<\/h3>\n<p>Triggers allow styles to change based on specific conditions. For example, you can change the button&#8217;s background color when the mouse hovers over the button:<\/p>\n<pre><code lang=\"xml\">\n            &lt;Style TargetType=\"Button\"&gt;\n                &lt;Setter Property=\"Background\" Value=\"LightBlue\" \/&gt;\n                &lt;Setter Property=\"Foreground\" Value=\"White\" \/&gt;\n                &lt;Style.Triggers&gt;\n                    &lt;Trigger Property=\"IsMouseOver\" Value=\"True\"&gt;\n                        &lt;Setter Property=\"Background\" Value=\"DarkBlue\" \/&gt;\n                    &lt;\/Trigger&gt;\n                &lt;\/Style.Triggers&gt;\n            &lt;\/Style&gt;\n            <\/code><\/pre>\n<h3>5.2 Data Binding<\/h3>\n<p>Data binding can be used in styles, allowing for dynamic updates of UI elements. For example, an example of binding color is as follows:<\/p>\n<pre><code lang=\"xml\">\n            &lt;Style TargetType=\"Button\"&gt;\n                &lt;Setter Property=\"Background\" Value=\"{Binding ButtonBackgroundColor}\" \/&gt;\n            &lt;\/Style&gt;\n            <\/code><\/pre>\n<h3>5.3 Applying Animations<\/h3>\n<p>Applying animations to UI elements can provide a more immersive user experience. The following is an example that gives an animation effect when a button is clicked:<\/p>\n<pre><code lang=\"xml\">\n            &lt;Style TargetType=\"Button\"&gt;\n                &lt;Setter Property=\"Opacity\" Value=\"1\" \/&gt;\n                &lt;Style.Triggers&gt;\n                    &lt;EventTrigger RoutedEvent=\"Button.Click\"&gt;\n                        &lt;BeginStoryboard&gt;\n                            &lt;Storyboard&gt;\n                                &lt;DoubleAnimation Storyboard.TargetProperty=\"Opacity\" From=\"1\" To=\"0\" Duration=\"0.5\" \/&gt;\n                            &lt;\/Storyboard&gt;\n                        &lt;\/BeginStoryboard&gt;\n                    &lt;\/EventTrigger&gt;\n                &lt;\/Style.Triggers&gt;\n            &lt;\/Style&gt;\n            <\/code><\/pre>\n<\/section>\n<section id=\"theme-resource-dictionary\">\n<h2>6. Using Theme Resource Dictionaries<\/h2>\n<p>In UWP apps, resource dictionaries can be used to manage themes. This allows for dynamic changes between various themes. For example, it is possible to create an app that supports dark mode and light mode.<\/p>\n<pre><code lang=\"xml\">\n            &lt;ResourceDictionary&gt;\n                &lt;Color x:Key=\"PrimaryColor\"&gt;#FF0078D7&lt;\/Color&gt;\n                &lt;Color x:Key=\"SecondaryColor\"&gt;#FFD83B00&lt;\/Color&gt;\n            &lt;\/ResourceDictionary&gt;\n            <\/code><\/pre>\n<p>With the resources defined this way, the app can be easily adjusted to fit the theme.<\/p>\n<\/section>\n<section id=\"conclusion\">\n<h2>7. Conclusion<\/h2>\n<p>Effectively using styles in UWP apps enables a consistent user experience while facilitating maintenance. In this article, we learned various styling methods through the basic concepts and application methods of styles, as well as advanced styling techniques. Since styling is an important element in UWP app development, it is essential to properly manage and utilize the styles of each element.<\/p>\n<\/section>\n<footer>\n<p>I hope this article has been helpful for UWP style development. If you have any additional questions or requests, please feel free to leave a comment!<\/p>\n<\/footer>\n<\/article>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article covers how to set styles in Universal Windows Platform (UWP) development on Windows, introducing the importance and application of styling through practical example code. 1. Introduction UWP is a platform that allows the development of modern apps that run on various Windows 10 devices. UWP apps can apply various styles to provide users &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37525\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;UWP Development, Style&#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-37525","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, Style - \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\/37525\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UWP Development, Style - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"This article covers how to set styles in Universal Windows Platform (UWP) development on Windows, introducing the importance and application of styling through practical example code. 1. Introduction UWP is a platform that allows the development of modern apps that run on various Windows 10 devices. UWP apps can apply various styles to provide users &hellip; \ub354 \ubcf4\uae30 &quot;UWP Development, Style&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37525\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:58:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:02:23+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\/37525\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37525\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"UWP Development, Style\",\"datePublished\":\"2024-11-01T09:58:16+00:00\",\"dateModified\":\"2024-11-01T11:02:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37525\/\"},\"wordCount\":495,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"UWP Programming\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37525\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37525\/\",\"name\":\"UWP Development, Style - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:58:16+00:00\",\"dateModified\":\"2024-11-01T11:02:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37525\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37525\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37525\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UWP Development, Style\"}]},{\"@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, Style - \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\/37525\/","og_locale":"ko_KR","og_type":"article","og_title":"UWP Development, Style - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"This article covers how to set styles in Universal Windows Platform (UWP) development on Windows, introducing the importance and application of styling through practical example code. 1. Introduction UWP is a platform that allows the development of modern apps that run on various Windows 10 devices. UWP apps can apply various styles to provide users &hellip; \ub354 \ubcf4\uae30 \"UWP Development, Style\"","og_url":"https:\/\/atmokpo.com\/w\/37525\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:58:16+00:00","article_modified_time":"2024-11-01T11:02:23+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\/37525\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37525\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"UWP Development, Style","datePublished":"2024-11-01T09:58:16+00:00","dateModified":"2024-11-01T11:02:23+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37525\/"},"wordCount":495,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["UWP Programming"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37525\/","url":"https:\/\/atmokpo.com\/w\/37525\/","name":"UWP Development, Style - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:58:16+00:00","dateModified":"2024-11-01T11:02:23+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37525\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37525\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37525\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"UWP Development, Style"}]},{"@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\/37525","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=37525"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37525\/revisions"}],"predecessor-version":[{"id":37526,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37525\/revisions\/37526"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}