{"id":37491,"date":"2024-11-01T09:58:00","date_gmt":"2024-11-01T09:58:00","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=37491"},"modified":"2024-11-01T11:02:30","modified_gmt":"2024-11-01T11:02:30","slug":"uwp-development-navigation","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/37491\/","title":{"rendered":"UWP Development, Navigation"},"content":{"rendered":"<p><body><\/p>\n<p>Navigation is a key element of user experience in Universal Windows Platform (UWP) development. Users should be able to easily access and navigate through various screens and data. This article will discuss how to implement navigation in UWP applications and various techniques related to it.<\/p>\n<h2>1. Understanding UWP Navigation<\/h2>\n<p>Navigation refers to the transition between screens within an application, allowing users to explore different parts of the application. In UWP, navigation between pages is primarily managed using the <code>Frame<\/code> class. Each page is defined by inheriting the <code>Page<\/code> class.<\/p>\n<h3>1.1 Frame and Page<\/h3>\n<p>The <code>Frame<\/code> is a control that provides page transitions. Users can switch to a new page through the <code>Frame<\/code> and can navigate back to the previous page using the <code>GoBack<\/code> and <code>GoForward<\/code> methods.<\/p>\n<h3>1.2 Creating a Page<\/h3>\n<p>To create a new page, you can use the <code>Page<\/code> template in Visual Studio to generate a file. Below is an example of a basic page class:<\/p>\n<pre><code>using Windows.UI.Xaml.Controls;\n\nnamespace YourAppNamespace\n{\n    public sealed partial class SamplePage : Page\n    {\n        public SamplePage()\n        {\n            this.InitializeComponent();\n        }\n    }\n}\n<\/code><\/pre>\n<h2>2. Methods of Navigation<\/h2>\n<p>UWP provides various methods for navigation. The most common methods include:<\/p>\n<ul>\n<li><strong>Direct navigation through frames<\/strong><\/li>\n<li><strong>Page transition on button click<\/strong><\/li>\n<li><strong>Navigation through model binding<\/strong><\/li>\n<\/ul>\n<h3>2.1 Direct Navigation through Frames<\/h3>\n<p>You can navigate directly to another page using the frame. The <code>Navigate<\/code> method of the frame object is used to switch pages. The example below shows how to move from <code>MainPage<\/code> to <code>SamplePage<\/code>:<\/p>\n<pre><code>private void NavigateToSamplePage()\n{\n    this.Frame.Navigate(typeof(SamplePage));\n}\n<\/code><\/pre>\n<h3>2.2 Page Transition on Button Click<\/h3>\n<p>You can implement navigation to a specific page when a user clicks a button. Below is an example of transitioning pages through a button click event:<\/p>\n<pre><code>&lt;Button Content=\"Go to Sample Page\" Click=\"NavigateButton_Click\" \/&gt;\n\nprivate void NavigateButton_Click(object sender, RoutedEventArgs e)\n{\n    this.Frame.Navigate(typeof(SamplePage));\n}\n<\/code><\/pre>\n<h3>2.3 Navigation through Model Binding<\/h3>\n<p>When using the MVVM pattern, navigation can be implemented through commands in the view model. Below is an example of navigation through model binding using the ICommand interface:<\/p>\n<pre><code>using System.Windows.Input;\n\npublic class MainViewModel\n{\n    public ICommand NavigateCommand { get; private set; }\n\n    public MainViewModel()\n    {\n        NavigateCommand = new RelayCommand(Navigate);\n    }\n\n    private void Navigate()\n    {\n        \/\/ Page navigation code\n    }\n}\n<\/code><\/pre>\n<h2>3. Backward and Forward Navigation<\/h2>\n<p>UWP also provides functionality to return to the previous page. Allowing users to easily return to the previous page is an important element that enhances user experience. The <code>Frame<\/code> class allows checking the status of the current navigation history through the <code>CanGoBack<\/code> and <code>CanGoForward<\/code> properties.<\/p>\n<pre><code>if (this.Frame.CanGoBack)\n{\n    this.Frame.GoBack();\n}\n<\/code><\/pre>\n<h2>4. Example Application of UWP Navigation<\/h2>\n<p>Now let&#8217;s create a simple UWP navigation example application. This application consists of two pages and switches pages through button clicks.<\/p>\n<h3>4.1 MainPage.xaml<\/h3>\n<pre><code>&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;StackPanel HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"&gt;\n        &lt;Button Content=\"Go to Sample Page\" Click=\"NavigateButton_Click\" \/&gt;\n    &lt;\/StackPanel&gt;\n&lt;\/Page&gt;\n<\/code><\/pre>\n<h3>4.2 SamplePage.xaml<\/h3>\n<pre><code>&lt;Page\n    x:Class=\"YourAppNamespace.SamplePage\"\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;StackPanel HorizontalAlignment=\"Center\" VerticalAlignment=\"Center\"&gt;\n        &lt;TextBlock Text=\"Sample Page\" FontSize=\"24\" \/&gt;\n        &lt;Button Content=\"Go Back\" Click=\"GoBackButton_Click\" \/&gt;\n    &lt;\/StackPanel&gt;\n&lt;\/Page&gt;\n<\/code><\/pre>\n<h3>4.3 MainPage.xaml.cs<\/h3>\n<pre><code>using 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 NavigateButton_Click(object sender, RoutedEventArgs e)\n        {\n            this.Frame.Navigate(typeof(SamplePage));\n        }\n    }\n}\n<\/code><\/pre>\n<h3>4.4 SamplePage.xaml.cs<\/h3>\n<pre><code>using Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\n\nnamespace YourAppNamespace\n{\n    public sealed partial class SamplePage : Page\n    {\n        public SamplePage()\n        {\n            this.InitializeComponent();\n        }\n\n        private void GoBackButton_Click(object sender, RoutedEventArgs e)\n        {\n            if (this.Frame.CanGoBack)\n            {\n                this.Frame.GoBack();\n            }\n        }\n    }\n}\n<\/code><\/pre>\n<h2>5. Conclusion<\/h2>\n<p>Navigation in UWP applications is a factor that greatly enhances the user experience. By using <code>Frame<\/code> and <code>Page<\/code>, it is easy to switch between multiple pages and provide users with intuitive and flexible navigation in various ways. The topics discussed in this article can be useful for implementing more complex applications.<\/p>\n<h2>6. Additional Resources<\/h2>\n<p>If you&#8217;re looking for more in-depth information about UWP navigation, please refer to the following links:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/design\/app-vs\">UWP Design Guidelines<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/uwp\/design\/develop\/navigating-between-pages\">Navigating Between Pages<\/a><\/li>\n<\/ul>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Navigation is a key element of user experience in Universal Windows Platform (UWP) development. Users should be able to easily access and navigate through various screens and data. This article will discuss how to implement navigation in UWP applications and various techniques related to it. 1. Understanding UWP Navigation Navigation refers to the transition between &hellip; <a href=\"https:\/\/atmokpo.com\/w\/37491\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;UWP Development, Navigation&#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-37491","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, Navigation - \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\/37491\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"UWP Development, Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"Navigation is a key element of user experience in Universal Windows Platform (UWP) development. Users should be able to easily access and navigate through various screens and data. This article will discuss how to implement navigation in UWP applications and various techniques related to it. 1. Understanding UWP Navigation Navigation refers to the transition between &hellip; \ub354 \ubcf4\uae30 &quot;UWP Development, Navigation&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/37491\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T09:58:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-01T11:02:30+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\/37491\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37491\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"UWP Development, Navigation\",\"datePublished\":\"2024-11-01T09:58:00+00:00\",\"dateModified\":\"2024-11-01T11:02:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37491\/\"},\"wordCount\":432,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"UWP Programming\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/37491\/\",\"url\":\"https:\/\/atmokpo.com\/w\/37491\/\",\"name\":\"UWP Development, Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T09:58:00+00:00\",\"dateModified\":\"2024-11-01T11:02:30+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/37491\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/37491\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/37491\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"UWP Development, Navigation\"}]},{\"@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, Navigation - \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\/37491\/","og_locale":"ko_KR","og_type":"article","og_title":"UWP Development, Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"Navigation is a key element of user experience in Universal Windows Platform (UWP) development. Users should be able to easily access and navigate through various screens and data. This article will discuss how to implement navigation in UWP applications and various techniques related to it. 1. Understanding UWP Navigation Navigation refers to the transition between &hellip; \ub354 \ubcf4\uae30 \"UWP Development, Navigation\"","og_url":"https:\/\/atmokpo.com\/w\/37491\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T09:58:00+00:00","article_modified_time":"2024-11-01T11:02:30+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\/37491\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/37491\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"UWP Development, Navigation","datePublished":"2024-11-01T09:58:00+00:00","dateModified":"2024-11-01T11:02:30+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/37491\/"},"wordCount":432,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["UWP Programming"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/37491\/","url":"https:\/\/atmokpo.com\/w\/37491\/","name":"UWP Development, Navigation - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T09:58:00+00:00","dateModified":"2024-11-01T11:02:30+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/37491\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/37491\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/37491\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"UWP Development, Navigation"}]},{"@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\/37491","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=37491"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37491\/revisions"}],"predecessor-version":[{"id":37492,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/37491\/revisions\/37492"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=37491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=37491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=37491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}