<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8838794302949839825</id><updated>2025-10-25T08:14:13.162+01:00</updated><category term="MVVM"/><category term="Windows 8"/><category term="Metro"/><category term="Cocoon"/><category term="MEF"/><category term="Okra"/><category term="Navigation"/><category term="Chrysalis"/><category term="DataLists"/><category term="Windows 8.1"/><category term="Windows Phone 7"/><category term="GitHub"/><category term="WPF"/><category term="Ribbon"/><category term="Windows Phone 8.1"/><category term="Android"/><category term="DropDownButton"/><category term="Windows 10"/><category term="dropshadows"/><category term="iOS"/><title type='text'>Andy On WPF, Windows 8 and Beyond</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-972851889743992286</id><published>2015-08-28T09:43:00.002+01:00</published><updated>2015-08-28T09:43:57.789+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GitHub"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 10"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8.1"/><title type='text'>Okra App Framework for Windows 10 Universal</title><content type='html'>&lt;i&gt;&lt;a href=&quot;http://okraframework.github.io/blog/2015/08/27/okra_v1_2.html&quot;&gt;[Cross posted from the official Okra App Framework blog]&lt;/a&gt;&lt;/i&gt;

&lt;h2 id=&quot;okra-app-framework-v12&quot;&gt;Okra App Framework v1.2&lt;/h2&gt;

&lt;p&gt;With the release of Windows 10, Microsoft have introduced the Universal Windows Platform with a single
API set and one app package to target PCs, tablets, phones and more. Today’s release of version 1.2 of
the Okra App Framework allows you to write apps that target Windows 10 devices.&lt;/p&gt;

&lt;p&gt;New in version 1.2 is,&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Windows 10 UAP support - Use the MVVM pattern to write a single app that runs on PCs, tablets and phones
running Windows 10.&lt;/li&gt;
  &lt;li&gt;Windows 10 UAP Visual Studio Template - A basic Visual Studio template is available to get you
started with developing Windows 10 apps.&lt;/li&gt;
  &lt;li&gt;Advanced Windows 10 features include,
    &lt;ul&gt;
      &lt;li&gt;Compiled binding support (see below)&lt;/li&gt;
      &lt;li&gt;Automatic support for hardware back buttons and tablet mode&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can get the Okra App Framework now by installing the Visual Studio extension, from NuGet or via GitHub. Full
details on how to download the framework are available &lt;a href=&quot;http://okraframework.github.io/documentation/okra_app_framework/getting_started_downloading.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;windows-10-compiled-binding-support&quot;&gt;Windows 10 Compiled Binding Support&lt;/h2&gt;

&lt;p&gt;Since the MVVM pattern relies heavily on data binding to bind the UI to the underlying view-model, data
binding performance is very important. The Universal Windows Platform introduces “compiled binding” as a
high performance data binding system.&lt;/p&gt;

&lt;p&gt;To use compiled bindings you use the new &lt;strong&gt;x:Bind&lt;/strong&gt; syntax,&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;p&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TextBlock&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;{x:Bind ViewModel.Title}&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note however that these bindings do not bind to the &lt;strong&gt;DataContext&lt;/strong&gt;, but instead to the page itself.
To support this, the Okra App Framework v1.2 introduces the &lt;strong&gt;IViewModelBindable&lt;/strong&gt; interface. This is applied
to the page code-behind as shown below,&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c#&quot; data-lang=&quot;c#&quot;&gt;&lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;sealed&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;partial&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;MyPage&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Page&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;IViewModelBindable&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;HomeViewModel&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ViewModel&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;SetViewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;viewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ViewModel&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;viewModel&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;HomeViewModel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;Bindings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Update&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can now take advantage of type-safe, high performance data binding using the &lt;strong&gt;x:Bind&lt;/strong&gt; syntax in your
Windows 10 projects.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/972851889743992286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/972851889743992286' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/972851889743992286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/972851889743992286'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2015/08/okra-app-framework-for-windows-10.html' title='Okra App Framework for Windows 10 Universal'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-6489940728887958714</id><published>2015-06-29T18:04:00.000+01:00</published><updated>2015-06-29T18:05:37.174+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="GitHub"/><category scheme="http://www.blogger.com/atom/ns#" term="iOS"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8.1"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Phone 8.1"/><title type='text'>Okra App Framework for Windows Phone 8.1 Released</title><content type='html'>&lt;h2&gt;
Okra App Framework v1.1&lt;/h2&gt;
&lt;p&gt;I’m pleased to announce that version 1.1 of the Okra App Framework has been released. For Windows 8.1
development there is not much new to report - the same great MVVM framework designed with Windows apps
in mind. The big news however is the official release of Windows Phone 8.1 support - it has been a couple
of months since the beta release and I’ve no bug reports so here it is.&lt;/p&gt;
&lt;p&gt;In summary the new NuGet packages include,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Windows 8.1 support - Create a new project using the Visual Studio templates and start using the MVVM pattern
straight away.&lt;/li&gt;
&lt;li&gt;Windows Phone 8.1 support - Simply add a new Windows Phone 8.1 project and reference the NuGet package.
The programming model is the same as for Windows 8.1, and most of your code should be sharable between projects.&lt;/li&gt;
&lt;li&gt;Portable Class Library support - In addition, a PCL version is included. This allows sharing of logic and
view-models in a single portable binary between Windows and Windows Phone projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can get the Okra App Framework now by installing the Visual Studio extension, from NuGet or via GitHub. Full
details on how to download the framework are available &lt;a href=&quot;http://okraframework.github.io/documentation/okra_app_framework/getting_started_downloading.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
Windows 10, Android and iOS&lt;/h2&gt;
&lt;p&gt;In other news, Windows 10 support has now been merged into the master branch of the framework. Unfortunately
NuGet currently does not have platform support for Windows 10, so this is not available via the NuGet packages.
If you wish to experiment with the latest bits you can download and build the source code from
&lt;a href=&quot;https://github.com/OkraFramework/Okra.Core&quot;&gt;the Okra.Core project on GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Additionally, many thanks go to Joel Fjordén who has made a start on Android and iOS support via Xamarin.Forms.
This is only the start, but if you want to experiment with cross-platform development then there are specific NuGet
packages on the Okra pre-release feed at &lt;a href=&quot;https://www.myget.org/F/okra/&quot;&gt;https://www.myget.org/F/okra/&lt;/a&gt;
(add this in the NuGet settings and make sure you have prerelease packages enabled).&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/6489940728887958714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/6489940728887958714' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/6489940728887958714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/6489940728887958714'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2015/06/okra-app-framework-for-windows-phone-81.html' title='Okra App Framework for Windows Phone 8.1 Released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-2704714002307336719</id><published>2015-04-26T15:53:00.003+01:00</published><updated>2015-04-26T15:53:30.319+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GitHub"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8.1"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Phone 8.1"/><title type='text'>Okra App Framework for Windows Phone 8.1 (beta)</title><content type='html'>[&lt;a href=&quot;http://okraframework.github.io/blog/2015/04/26/okra_v1_1_beta001.html&quot;&gt;&lt;i&gt;Cross posted from the Okra Framework blog&lt;/i&gt;&lt;/a&gt;]&lt;br /&gt;
&lt;h2&gt;
Okra App Framework for Windows Phone 8.1&lt;/h2&gt;
Following on from the recent &lt;a href=&quot;http://okraframework.github.io/blog/2015/04/09/okra_v1_0.html&quot;&gt;v1.0 release of the Okra App Framework&lt;/a&gt;, preview support for Windows Phone 8.1 is now available. This will be wrapped up in an upcoming v1.1 release, but as of today a beta release is downloadable via NuGet (turn on support for preview versions and look for the v1.1.0-beta001 package).&lt;br /&gt;
&lt;br /&gt;
This package includes,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Windows Phone 8.1 support - Simply add a new Windows Phone 8.1 project and reference the NuGet package. The programming model is the same as for Windows 8.1, and most of your code should be sharable between projects.&lt;/li&gt;
&lt;li&gt;Portable Class Library support - In addition a PCL version is included, which allows sharing of logic and view-models in a single portable binary between Windows and Windows Phone projects.&lt;/li&gt;
&lt;/ul&gt;
Get in touch with any bugs or comments via the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/issues?q=is%3Aissue+is%3Aopen&quot;&gt;Okra.Core issue tracker&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;
Okra App Framework for Windows 10&lt;/h2&gt;
In addition to the beta relase, progress is going well on a Windows 10 port of the Okra App Framework. Whilst this is not currently available via NuGet, you can check out and build the code via the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/tree/win-10&quot;&gt;Okra.Core/win-10 branch&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/2704714002307336719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/2704714002307336719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/2704714002307336719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/2704714002307336719'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2015/04/okra-app-framework-for-windows-phone-81.html' title='Okra App Framework for Windows Phone 8.1 (beta)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-1098492395450234049</id><published>2015-04-10T19:46:00.000+01:00</published><updated>2015-04-10T19:46:26.267+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8.1"/><title type='text'>Okra App Framework v1.0 Released</title><content type='html'>[&lt;i&gt;&lt;a href=&quot;http://okraframework.github.io/blog/2015/04/09/okra_v1_0.html&quot;&gt;Cross posted from the new Okra Framework blog&lt;/a&gt;&lt;/i&gt;]&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
I am really happy to announce that version 1.0 of the Okra App Framework has officially been released. For those new to the framework, it is an MVVM framework designed from the ground up to be great for creating Windows apps. Dependency injection is baked in to allow you to create easy to maintain, test and reuse code. A number of advanced features allow simple integration with application settings, app-to-app sharing and search. In addition a full set of Visual Studio templates is available to get you started with MVVM development.&lt;br /&gt;
For more information checkout the &lt;a href=&quot;http://okraframework.github.io/&quot;&gt;Okra Framework website&lt;/a&gt;.&lt;br /&gt;
You can get the Okra App Framework now by installing the Visual Studio extension, from NuGet or GitHub. Full details on how to download the framework are available &lt;a href=&quot;http://okraframework.github.io/documentation/okra_app_framework/getting_started_downloading.html&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
In addition to the release of the framework we have,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://okraframework.github.io/blog&quot;&gt;A new blog for all the latest news and updates on the framework&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://okraframework.github.io/documentation&quot;&gt;Documentation covering everything from download instructions to advanced navigation scenarios&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://okraframework.github.io/samples&quot;&gt;Updated sample projects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/OkraFramework/Okra-Todo&quot;&gt;A new end-to-end application sample, Okra-Todo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;changes-from-v098&quot;&gt;
Changes from v0.9.8&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/issues/57&quot;&gt;Settings panes can now derive from SettingsFlyout&lt;/a&gt; - This allows you to use the full Visual Studio designer experience for the settings pane UI&lt;/li&gt;
&lt;li&gt;The Visual Studio settings pane template now derives from SettingsFlyout by default&lt;/li&gt;
&lt;li&gt;All classes/methods/properties/events marked as obsolete in v0.9.8 have been removed for the v1.0 release&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/issues?q=milestone%3Av1.0.0+is%3Aclosed&quot;&gt;A number of other minor bug fixes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;okra-app-framework-vnext&quot;&gt;
Okra App Framework vNext&lt;/h2&gt;
The next step for the Okra App Framework v1.1 is to support other platforms, in particular Windows Phone 8.1 and preview support for Windows 10. Much of the development on these features is already complete so expect to see a beta release in the near future. You can check out progress and submit bugs and feature requests on the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/issues?q=is%3Aissue+is%3Aopen&quot;&gt;Okra.Core issue tracker&lt;/a&gt;. For more information on feature progress on the v1.1 release you can look at the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/milestones/v1.1.0&quot;&gt;v1.1.0 milestone progress page&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/1098492395450234049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/1098492395450234049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/1098492395450234049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/1098492395450234049'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2015/04/okra-app-framework-v10-released.html' title='Okra App Framework v1.0 Released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-9222905056909034704</id><published>2014-10-27T21:17:00.001+00:00</published><updated>2014-10-27T21:17:52.153+00:00</updated><title type='text'>Okra App Framework v0.9.8</title><content type='html'>&lt;p&gt;For those of you following the Okra App Framework, I can announce that v0.9.8 has been released today. This release is mainly aimed at converging on a stable API for v1.0, although a small number of new features have also been included.&lt;/p&gt; &lt;p&gt;Details of how to obtain the latest version of the framework are available &lt;a href=&quot;http://okraframework.github.io/documentation/okra_app_framework/getting_started_downloading.html&quot;&gt;here&lt;/a&gt;. In the approach to v1.0 I’d be very interested in any feedback and bug reports, which you can post in the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/issues&quot;&gt;Okra.Core issues tracker&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;New Features in v0.9.8&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;You can now navigate back multiple pages in the navigation stack, for example directly to the application home page from deep in the navigation hierarchy. This is supported by an INavigationStack.GoBackTo(…) method and associated extension methods.&lt;/li&gt; &lt;li&gt;Built in support for keyboard back navigation.&lt;/li&gt; &lt;li&gt;Built in support for mouse back button navigation.&lt;/li&gt; &lt;li&gt;Support for variable-sized settings panes has been reintroduced. The width can be set using a SettingsPaneInfo.Width property in your XAML.&lt;/li&gt; &lt;li&gt;A number of minor bug fixes.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Code Changes When Updating From v0.9.7&lt;/h2&gt; &lt;p&gt;In readiness for a v1.0 release, a number of breaking changes have been made,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Any methods that return or consume the WinRT ‘NavigationMode’ enumeration now use an Okra specific ‘PageNavigationMode’ enumeration.&lt;/li&gt; &lt;li&gt;Sharing support (for both share targets and share sources) has been moved into a new ‘Okra.Sharing’ namespace along with a number of changes to the API surface. This removes dependencies to WinRT types and allows sharing code to be included in portable class libraries.&lt;/li&gt; &lt;li&gt;The INavigationTarget.NavigateTo(…) method now takes an associated INavigationBase as a second parameter.&lt;/li&gt; &lt;li&gt;The FlyoutPane class and FlyoutEdge enumeration have been marked as obsolete and will be removed prior to v1.0. If you still require this control then feel free to include the source code directly in your solution (&lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/blob/8662f150852a39d1c585c6fcea4204ac9d1401ec/src/Okra.Core/Okra.Core.Shared/UI/FlyoutPane.cs&quot;&gt;FlyoutPane code&lt;/a&gt;, &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/blob/8662f150852a39d1c585c6fcea4204ac9d1401ec/src/Okra.Core/Okra.Core.Shared/UI/FlyoutEdge.cs&quot;&gt;FlyoutEdge code&lt;/a&gt;).&lt;/li&gt;&lt;/ul&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/9222905056909034704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/9222905056909034704' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/9222905056909034704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/9222905056909034704'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2014/10/okra-app-framework-v098.html' title='Okra App Framework v0.9.8'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-1777908316137176501</id><published>2014-08-10T21:45:00.001+01:00</published><updated>2014-08-10T21:45:02.469+01:00</updated><title type='text'>New Website for the Okra Framework</title><content type='html'>&lt;p&gt;In addition to &lt;a href=&quot;http://andyonwpf.blogspot.com/2014/08/okra-framework-is-now-on-github.html&quot;&gt;moving to GitHub&lt;/a&gt; I would like to announce that the Okra Framework has a new website. Find us at,&lt;/p&gt; &lt;p&gt;&lt;a title=&quot;http://okraframework.github.io/&quot; href=&quot;http://okraframework.github.io/&quot;&gt;http://okraframework.github.io/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This website is the new location for information about the framework and all official documentation. Since it is hosted using GitHub Pages you can also contribute to the documentation by submitting a pull request to the &lt;a href=&quot;https://github.com/OkraFramework/OkraFramework.github.io&quot;&gt;website repository&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Look forward to seeing you all there…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/1777908316137176501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/1777908316137176501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/1777908316137176501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/1777908316137176501'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2014/08/new-website-for-okra-framework.html' title='New Website for the Okra Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-5234351591319417796</id><published>2014-08-10T21:39:00.001+01:00</published><updated>2014-08-10T21:39:00.825+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GitHub"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><title type='text'>Okra Framework is now on GitHub</title><content type='html'>&lt;p&gt;Anyone who has been following the Okra App Framework (an MVVM framework designed for creating great Windows 8 apps) will know that up until now the project has been hosted on CodePlex. From this point onwards all further development will be based on GitHub. The new url is,&lt;/p&gt; &lt;p align=&quot;left&quot;&gt;&lt;a title=&quot;https://github.com/OkraFramework&quot; href=&quot;https://github.com/OkraFramework&quot;&gt;https://github.com/OkraFramework&lt;/a&gt;&lt;/p&gt; &lt;p&gt;On the new GitHub site you will find,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;All the source code for &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core&quot;&gt;Okra.Core&lt;/a&gt; and &lt;a href=&quot;https://github.com/OkraFramework/Okra.Data&quot;&gt;Okra.Data&lt;/a&gt;&lt;/li&gt; &lt;li&gt;All releases from v0.9.7 going forward&lt;/li&gt; &lt;li&gt;A new issue tracker for managing bug reports and feature requests (I have migrated all open issues from CodePlex)&lt;/li&gt; &lt;li&gt;Okra feature samples as part of the &lt;a href=&quot;https://github.com/OkraFramework/Okra-Samples&quot;&gt;Okra-Samples&lt;/a&gt; repository&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Contributing to the Okra Framework&lt;/h2&gt; &lt;p&gt;As part of the move to GitHub I am aiming to be more proactive in accepting any community contributions to the project. The first thing I would welcome is the continued submission of bug reports and feature requests to the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/issues&quot;&gt;Okra.Core issue tracker&lt;/a&gt; and the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Data/issues&quot;&gt;Okra.Data issue tracker&lt;/a&gt;. I’m always interested in hearing in how users are using the framework and any problems they encounter.&lt;/p&gt; &lt;p&gt;If you would like to contribute any code to the project then I’d be really happy to accept pull requests (no matter how small). Try to keep these focused on one issue per pull request (this helps me get an overview of the changes before I merge them) and for anything but small bug fixes open an issue in the issue tracker first (so we can discuss the best way to approach it). Some simple contribution guidelines are available in the &lt;a href=&quot;https://github.com/OkraFramework/Okra.Core/blob/master/CONTRIBUTING.md&quot;&gt;CONTRIBUTING.md&lt;/a&gt; file at the root of each project.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/5234351591319417796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/5234351591319417796' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5234351591319417796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5234351591319417796'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2014/08/okra-framework-is-now-on-github.html' title='Okra Framework is now on GitHub'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-295561795934161606</id><published>2014-07-07T20:22:00.000+01:00</published><updated>2014-07-07T20:22:38.520+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8.1"/><title type='text'>Windows Store MVVM Development with the Okra App Framework v0.9.7</title><content type='html'>&lt;p&gt;After a bit of hiatus, the latest version of the Okra App Framework has been released. The v0.9.7 release of the Windows Store centric MVVM framework targets Windows 8.1, and focuses on tidying up some of the API surface prior to an upcoming v1.0 release.&lt;/p&gt; &lt;h2&gt;How to Get The Okra App Framework&lt;/h2&gt; &lt;p&gt;You can download the latest version of the Okra App Framework,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;From NuGet: For the complete MVVM framework add the “&lt;a href=&quot;http://www.nuget.org/Packages/Okra.MEF&quot;&gt;Okra App Framework&lt;/a&gt;” NuGet package to your project.&lt;/li&gt; &lt;li&gt;Using the Visual Studio Extension: The official Okra App Framework Visual Studio extension has been updated for the latest release with all new project and item templates targeting Windows 8.1. Look for the “&lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/4cac9393-772c-49ab-af20-9dbf9972adf7&quot;&gt;Windows Store MVVM Templates for the Okra App Framework&lt;/a&gt;” extension in the Visual Studio gallery or directly from the Extensions and Updates manager in Visual Studio.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;New Features in This Release&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;The big change with this update is that the Okra App Framework is now targeting Windows 8.1 development. The framework makes the most of the recent improvements in the underlying operating system, with a number of changes reflecting the new API surface. Note however that this release no longer supports Windows 8.0 projects, which should continue to use v0.9.6.&lt;/li&gt; &lt;li&gt;All new Windows 8.1 project and item templates for Visual Studio. These are based upon the Visual Studio 2013 templates, but rewritten to take advantage of the MVVM pattern.&lt;/li&gt; &lt;li&gt;The Okra Data Framework is now available as a separate download (see the “&lt;a href=&quot;http://www.nuget.org/packages/Okra.Data/&quot;&gt;Okra App Framework (Data Framework)&lt;/a&gt;” package in NuGet) so you can choose to use this independently of the core framework if desired.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Code Changes When Updating From v0.9.6&lt;/h2&gt; &lt;p&gt;In readiness for a v1.0 release, a number of breaking changes have been made,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;To simplify page activation the IActivatable interface in no longer generic. Instead of directly passing the page arguments and state, a PageInfo object is used instead.&lt;/li&gt; &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;// Old code using the Okra App Framework v0.9.6&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : ViewModelBase, IActivatable&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; Activate(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; arguments, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; state)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.Photo = GetPhoto(arguments);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.State = state;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; SaveState()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.State;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;// New code using the Okra App Framework v.0.9.7&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : ViewModelBase, IActivatable&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; Activate(PageInfo pageInfo)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; arguments = pageInfo.GetArguments&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt;();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.Photo = GetPhoto(arguments);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.State = pageInfo.GetState&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt;(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MyState&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SaveState(PageInfo pageInfo)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;        pageInfo.SetState&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt;(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MyState&quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.State);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;li&gt;To allow more flexible navigation patterns a number of properties and methods have been moved from INavigationBase to INavigationStack (accessible from any INavigationBase via the NavigationStack property).&lt;/li&gt;&lt;li&gt;Since the Windows 8.1 update includes a system provided SettingsFlyout control, you no longer need to wrap any settings pages in a SettingsChrome control.&lt;/li&gt;&lt;/ul&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/295561795934161606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/295561795934161606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/295561795934161606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/295561795934161606'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2014/07/windows-store-mvvm-development-with.html' title='Windows Store MVVM Development with the Okra App Framework v0.9.7'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-2912048713573340925</id><published>2013-05-29T21:03:00.002+01:00</published><updated>2013-05-29T21:03:57.734+01:00</updated><title type='text'>Sharing App Content using MVVM and the Okra App Framework</title><content type='html'>&lt;p&gt;One of the key differentiating features of the Windows Store application model in Windows 8 is the availability of system provided “charms” for common tasks such as sharing, search and application settings. In this post I will focus on sharing, and how the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt; makes it easy to incorporate this functionality into applications using the MVVM pattern.&lt;/p&gt; &lt;h2&gt;How to share content the Windows 8 way?&lt;/h2&gt; &lt;p&gt;The &lt;a href=&quot;http://msdn.microsoft.com/library/windows/apps/Hh871368(v=win.10).aspx&quot;&gt;MSDN documentation&lt;/a&gt; details how to share content from Windows Store apps in C#/VB. The first step is to get a reference to the application’s DataTransferManager, and then register for its DataRequested event. When the user selects the share charm this event is fired, passing a DataRequestedEventArgs object to the event handler.&lt;/p&gt; &lt;p&gt;There are a number of problems with this approach in the context of an MVVM application,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The content to share should be determined dynamically based upon the page displayed and any user selected content. In the MVVM pattern this is best accomplished by the view-model, and not by a single event handler.  &lt;li&gt;The application specific sharing code is passed a DataRequestedEventArgs object (which is a sealed class with no public constructors). This makes unit testing this code difficult.  &lt;li&gt;Supporting pull operations (see the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/apps/hh871375.aspx&quot;&gt;MSDN documentation on this topic&lt;/a&gt;) requires additional event handler registration, not following the typical Task based async support used elsewhere.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Sharing content with the Okra App Framework&lt;/h2&gt; &lt;p&gt;The Okra App Framework overcomes these problems, whilst maintaining the power of the sharing contract by allowing view-models to implement a simple, easily unit-testable, IShareable interface. The framework will handle all the other infrastructure required for application sharing. Since the IShareable interface is applied to the view-model, a ‘ViewPhoto’ page can share an individual photo, whilst a ‘ViewAlbum’ page can share the whole album (or selected photos if the user has done so).&lt;/p&gt; &lt;p&gt;The first step in adding sharing support to an application is to add a reference to an IShareSourceManager in the application bootstrapper.&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; AppBootstrapper : OkraBootstrapper&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    [Import]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; IShareSourceManager ShareSourceManager { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;You can then add the IShareable interface to any view-model that has suitable data to share,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MyPage&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : IShareable&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ShareRequested(IDataRequest dataRequest)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;You will notice that the ShareRequested method is passed an IDataRequest object in which to return the data to share. This is a unit-testable wrapper around the WinRT DataRequest object and the standard &lt;a href=&quot;http://msdn.microsoft.com/library/windows/apps/Hh871368(v=win.10).aspx&quot;&gt;MSDN documentation&lt;/a&gt; can be followed from this point to respond to the share request. For example to share some text you would implement this as follows,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MyPage&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : IShareable&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ShareRequested(IDataRequest dataRequest)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        dataRequest.Data.Properties.Title = &lt;span style=&quot;color: #006080&quot;&gt;&quot;...&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        dataRequest.Data.Properties.Description = &lt;span style=&quot;color: #006080&quot;&gt;&quot;...&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        request.Data.SetText(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Hello World!&quot;&lt;/span&gt;);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Sharing content asynchronously (optional)&lt;/h2&gt;&lt;p&gt;There are occasions when you may wish to only download the data once the user has completed the share request (e.g. when sharing a large file from a web service) – these are known as pull operations. The Okra App Framework provides extension methods to allow you to implement pull operations using the async features of .Net. For each SetXXX(…) method, Okra provides a corresponding SetAsyncXXX(…) method. For example, the code below demonstrates how to return text returned from some async method call. Note the signature of the GetShareTextAsync(…) method.&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MyPage&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : IShareable&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ShareRequested(IDataRequest dataRequest)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        request.Data.SetAsyncText(GetShareTextAsync);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; async Task&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt;&amp;gt; GetShareTextAsync(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; formatId, DateTimeOffset deadline)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; text = await SomeAsyncMethod();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; text;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/2912048713573340925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/2912048713573340925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/2912048713573340925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/2912048713573340925'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2013/05/sharing-app-content-using-mvvm-and-okra.html' title='Sharing App Content using MVVM and the Okra App Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-4447007227662121521</id><published>2013-05-12T21:31:00.000+01:00</published><updated>2013-05-12T21:31:35.511+01:00</updated><title type='text'>Windows Store MVVM Templates for Visual Studio</title><content type='html'>&lt;p&gt;If you have ever tried to create a Windows Store application using the MVVM pattern then you will probably have found that the Visual Studio project and item templates are a bit cumbersome. I often find myself adding a new page to my projects using one of the default templates, only to need to rewrite it to follow the MVVM pattern before I can even start adding application specific logic. What if there was a way to take advantage of the selection of project and page templates provided by Visual Studio, but have them produce fully MVVM compliant code?&lt;/p&gt;
&lt;p&gt;Well today I’d like to announce the release of a free extension for Visual Studio 2012 (including the Express editions for Windows 8) that provides just that. It is based upon the open source &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt;, and provides almost all of the Visual Studio Windows Store templates in an MVVM friendly manner.&lt;/p&gt;
&lt;h2&gt;
Installing the Extension&lt;/h2&gt;
&lt;p&gt;The “Windows Store MVVM Templates for the Okra App Framework” extension is available for download from the &lt;a href=&quot;http://visualstudiogallery.msdn.microsoft.com/4cac9393-772c-49ab-af20-9dbf9972adf7?SRC=Home&quot;&gt;Visual Studio Gallery&lt;/a&gt;, or available directly in the Visual Studio Extensions and Updates manager (the recommended method). Instructions for installing via Visual Studio are available at the &lt;a href=&quot;http://okra.codeplex.com/wikipage?title=Downloading%20the%20Okra%20App%20Framework&quot;&gt;Downloading the Okra App Framework&lt;/a&gt; page in the Okra App Framework documentation.&lt;/p&gt;
&lt;h2&gt;
What Templates are Provided?&lt;/h2&gt;
&lt;p&gt;There are two types of template included, project templates and item templates. The project templates are designed to get you started with a new application and provide exactly the same behaviour as the default Visual Studio templates (but written following the MVVM pattern).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Okra Basic App - A single-page Okra App Framework project with no predefined controls or layout.
&lt;li&gt;Okra Grid App - A three-page Okra App Framework project that navigates among grouped items arranged in a grid. Dedicated pages display group and item details.
&lt;li&gt;Okra Split App - A two-page Okra App Framework project that navigates among grouped items. The first page allows group selection while the second displays an item list alongside details for the selected item.&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CM1SArBPBbatc7LJMeM4zU5wX21TsmOpGaafmBKUP-UqHKGyL3S-wPQc_uRvehhWtSgGB59NfMOSHbcxaFmBW-MYXvrfA_eYL0IwdOvyfQ14NDEORJBVioltogJUXD4sabw6pHe-FKg/s1600/New+Project+Dialog.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CM1SArBPBbatc7LJMeM4zU5wX21TsmOpGaafmBKUP-UqHKGyL3S-wPQc_uRvehhWtSgGB59NfMOSHbcxaFmBW-MYXvrfA_eYL0IwdOvyfQ14NDEORJBVioltogJUXD4sabw6pHe-FKg/s400/New+Project+Dialog.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Also included are a number of item templates that allow you to add new pages to any existing Okra App Framework based application, whether created using the project templates or not.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Basic Page (MVVM)
&lt;li&gt;Split Page (MVVM)
&lt;li&gt;Items Page (MVVM)
&lt;li&gt;Item Detail Page (MVVM)
&lt;li&gt;Grouped Items Page (MVVM)
&lt;li&gt;Group Detail Page (MVVM)
&lt;li&gt;Search Contract (MVVM)
&lt;li&gt;Share Target Contract (MVVM)
&lt;li&gt;Settings Pane (MVVM) &lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp9Wt17k_1X6gSiNRkVVS4oWFFg62CJWznR41BLZ-mXRG2Cj5v52PRLFHhEaTZZHqwk8xF4lZXJ0j_oH63fDfEEVDXK7MUSo6CadYk1xUG2OeI-FnxuIZ_guRoeCgiLUGUjwUpxAjbS70/s1600/New+Item+Dialog.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;275&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp9Wt17k_1X6gSiNRkVVS4oWFFg62CJWznR41BLZ-mXRG2Cj5v52PRLFHhEaTZZHqwk8xF4lZXJ0j_oH63fDfEEVDXK7MUSo6CadYk1xUG2OeI-FnxuIZ_guRoeCgiLUGUjwUpxAjbS70/s400/New+Item+Dialog.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjp9Wt17k_1X6gSiNRkVVS4oWFFg62CJWznR41BLZ-mXRG2Cj5v52PRLFHhEaTZZHqwk8xF4lZXJ0j_oH63fDfEEVDXK7MUSo6CadYk1xUG2OeI-FnxuIZ_guRoeCgiLUGUjwUpxAjbS70/s1600/New+Item+Dialog.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;h2&gt;
What do the MVVM Pages Look Like?&lt;/h2&gt;
&lt;p&gt;All the page templates (and each of the pages in the project templates) include the following files,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A XAML file containing the UI design, as well as an associated code-behind file. Since we are following the MVVM pattern this code-behind file contains very little logic.&lt;/li&gt;
&lt;li&gt;A view-model that contains the properties and logic for the page.&lt;/li&gt;
&lt;li&gt;In addition a file for design-time data is provided. This allows you to easily layout complex user interfaces in the designer with a visual representation of how the resulting page will look.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuPqHTlZGR8ReiiupPBXg-CfC5TrG0VLFxbRqGyqGL-oNLbeeGOSfi-mPJo8f2m8antF-Tie0aSfRlIFjWK3mzzKofYWgccZmBb7oAvUJYdSVFlm98BYBGS4d9xrsAe2cU1mQvgNWiCg/s1600/Project+Structure+Small.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOuPqHTlZGR8ReiiupPBXg-CfC5TrG0VLFxbRqGyqGL-oNLbeeGOSfi-mPJo8f2m8antF-Tie0aSfRlIFjWK3mzzKofYWgccZmBb7oAvUJYdSVFlm98BYBGS4d9xrsAe2cU1mQvgNWiCg/s1600/Project+Structure+Small.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
Summary&lt;/h2&gt;
&lt;p&gt;As I have discussed the new “Windows Store MVVM Templates for the Okra App Framework” make it quick and easy to implement pages following the MVVM pattern for use in Windows Store applications. The behaviour of all the templates has been designed to be identical to the default Visual Studio templates, with the added benefit of clean separation of code, unit testability and design-time data.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/4447007227662121521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/4447007227662121521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4447007227662121521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4447007227662121521'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2013/05/windows-store-mvvm-templates-for-visual.html' title='Windows Store MVVM Templates for Visual Studio'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5CM1SArBPBbatc7LJMeM4zU5wX21TsmOpGaafmBKUP-UqHKGyL3S-wPQc_uRvehhWtSgGB59NfMOSHbcxaFmBW-MYXvrfA_eYL0IwdOvyfQ14NDEORJBVioltogJUXD4sabw6pHe-FKg/s72-c/New+Project+Dialog.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-4692764859143815622</id><published>2013-03-24T16:44:00.000+00:00</published><updated>2013-03-24T16:44:14.954+00:00</updated><title type='text'>Improvements in Version 0.9.6 of the Okra App Framework</title><content type='html'>&lt;p&gt;&lt;em&gt;To start off I would like to announce that I have just pushed a minor fix for the Okra App Framework NuGet packages with the version number v0.9.6.1. This fixes an issue with the NuGet packaging and contains the same code base as the recent v0.9.6 release. If you have previously updated to v0.9.6 via NuGet I would recommend you update to the new packages. Anyone who has downloaded the source code releases of v0.9.6 do not need to make any changes.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;Following that brief announcement I would like to use the rest of this post to discuss a couple of changes that were made with the &lt;a href=&quot;http://andyonwpf.blogspot.com/2013/03/okra-app-framework-v096-released.html&quot;&gt;recent v0.9.6 release of the Okra App Framework&lt;/a&gt; to support more advanced activation and navigation scenarios. The good news is that these changes should not affect any existing code, however you may wish to implement these changes to take full advantage of future features within Okra.&lt;/p&gt; &lt;h2&gt;Activation of Applications via the OkraApplication class&lt;/h2&gt; &lt;p&gt;In previous releases of the Okra App Framework the recommended way of initializing your application was to create an AppBootstrapper class that derived from OkraBootstrapper. This would then be initialized from your App.xaml.cs file’s constructor,&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; App : Application&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; App()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.InitializeComponent();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;// *** NB: THIS CODE IS NOT RECOMMENDED! ***&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        AppBootstrapper bootstrapper = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; AppBootstrapper();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        bootstrapper.Initialize();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Whilst this will continue to work for existing applications based on the Okra App Framework, this approach does not support certain types of activation, in particular the recently introduced share target support.&lt;/p&gt;&lt;p&gt;Instead the recent release has introduced an OkraApplication class that should be used to derive your App class from. The AppBootstrapper is still required and needs no further changes, however the OkraApplication class will ensure that all activation events are recognised.&lt;/p&gt;&lt;p&gt;The changes that you should make are:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Change your App.xaml.cs class to read,&lt;/li&gt;&lt;/ul&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; App : OkraApplication&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; App()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        : &lt;span style=&quot;color: #0000ff&quot;&gt;base&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; AppBootstrapper())&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.InitializeComponent();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Change the type of your App.xaml definition to be derived from OkraApplication (NB: Only the changes are shown in the code snippet below),&lt;/li&gt;&lt;/ul&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;okra:OkraApplication&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns:okra&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;using:Okra&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;okra:OkraApplication&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Introduction of INavigationContext&lt;/h2&gt;&lt;p&gt;The second feature I will discuss is the introduction of the INavigationContext interface. This is designed to allow more consistent navigation code, better code reuse and better support for more advanced navigation scenarios (such as those discussed &lt;a href=&quot;http://okra.codeplex.com/discussions/406171&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://konaguidance.codeplex.com/discussions/433199&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;In previous releases of the Okra App Framework you would support navigation from you view-model by importing an INavigationManager. For example,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : NotifyPropertyChangedBase&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #008000&quot;&gt;// *** NB: NO LONGER RECOMMENDED ***&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    [Import]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    INavigationManager NavigationManager { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;If you were writing a settings pane then INavigationManager would be replaced with ISettingsPaneManager, and in other cases (such as file pickers or in multiple navigation applications) you may have a number of simultaneous navigation stacks of the same type to choose from.&lt;/p&gt;&lt;p&gt;With the v0.9.6 release of the Okra App Framework this has all been consolidated into a single INavigationContext interface. This can be imported via your view-models constructor and will return the correct navigation manager for the current page’s context,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MyViewModel : NotifyPropertyChangedBase&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    INavigationBase NavigationManager { get; &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    [ImportingConstructor]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; MyViewModel(INavigationContext context)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;.NavigationManager = context.GetCurrent();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;     ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;The advantage of this approach is that you can use the same code in any of the cases mentioned above, and even reuse the same view-model definition between different contexts.&lt;/p&gt;&lt;h2&gt;Summary&lt;/h2&gt;&lt;p&gt;In this post I have discussed a couple of improvements in the latest release of the Okra App Framework. Whilst existing code should continue to work using the old mechanisms, I would recommend that you adapt your code to take advantage of the benefits described above.&lt;/p&gt;&lt;p&gt;Version 0.9.6 of the Okra App Framework is available from the Okra &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;CodePlex&lt;/a&gt; site and via &lt;a href=&quot;http://www.nuget.org/Packages/Okra.MEF&quot;&gt;NuGet&lt;/a&gt; (v0.9.6.1). &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/4692764859143815622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/4692764859143815622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4692764859143815622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4692764859143815622'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2013/03/improvements-in-version-096-of-okra-app.html' title='Improvements in Version 0.9.6 of the Okra App Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-8723881419237373819</id><published>2013-03-21T22:16:00.001+00:00</published><updated>2013-03-21T22:17:56.716+00:00</updated><title type='text'>Okra App Framework v0.9.6 Released</title><content type='html'>&lt;p&gt;The latest update to the Okra App Framework has just been released and is available from the Okra &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;CodePlex&lt;/a&gt; site and via &lt;a href=&quot;http://www.nuget.org/Packages/Okra.MEF&quot;&gt;NuGet&lt;/a&gt;. &lt;h2&gt;New Features in This Release&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;Support for the share charm (more information on these in a future post),&lt;/li&gt; &lt;ul&gt; &lt;li&gt;View-model centric share source support – by implementing ISharable on view-models they can automatically provide context specific sharing of data with other applications.&lt;/li&gt; &lt;li&gt;MVVM based share target support – implement a share target to accept data from other applications via a specified view/view-model.&lt;/li&gt; &lt;li&gt;Helper methods for task based asynchronous data sharing.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;New OkraApplication base class that will allow the framework to handle more advanced activation events in the future (more on this in a future post).&lt;/li&gt; &lt;li&gt;Introduction of an INavigationContext that can be imported into views and view-models (more on this in a future post).&lt;/li&gt; &lt;li&gt;The INavigationBase interface now has an additional CanNavigateTo(…) method that allows consumers to determine if a named page is available without performing the navigation.&lt;/li&gt; &lt;li&gt;Refactoring of state persistence into the NavigationBase abstract class to allow reuse of this logic in custom navigation scenarios.&lt;/li&gt; &lt;li&gt;Additional events are raised,&lt;/li&gt; &lt;ul&gt; &lt;li&gt;upon navigation between pages (on INavigationBase)&lt;/li&gt; &lt;li&gt;upon flyout opening/closing (on ISettingsPaneManager)&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;All exceptions on application start-up should now be injected back into the application and not lost.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Breaking Changes&lt;/h2&gt; &lt;p&gt;There are a small number of breaking changes in this release of the framework, however most of these are unlikely to apply to users of the framework (they are mostly under-the-hood interface changes that would only be applicable in advanced scenarios).&lt;/p&gt; &lt;p&gt;The only important change is,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The default OkraBootstrapper base class no longer implements the SearchManager property. If you are using the Okra search functionality then you should simply add the following code to your application bootstrapper.&lt;/li&gt;&lt;/ul&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[Import]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; ISearchManager SearchManager { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;For reference the other breaking changes are,&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The SearchManager implementation now includes a default search page name (specified in the SpecialPageNames class). Since search is now opt-in this should not cause problems for existing code.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Removal of the obsolete SetupNavigationManager() method from OkraBootstrapper – this code can simply be placed in the SetupServices() method instead.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;This IViewFactory now accepts an INavigationContext when creating pages. This should be injected during the composition process (handled automatically by the default MEF implementation).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Additional methods/properties to the INavigationBase, IViewFactory and ISettingsPaneManager interfaces. These will need to be added to any custom implementations.&lt;/li&gt;&lt;/ul&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/8723881419237373819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/8723881419237373819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/8723881419237373819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/8723881419237373819'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2013/03/okra-app-framework-v096-released.html' title='Okra App Framework v0.9.6 Released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-4630369088731444699</id><published>2013-02-04T21:52:00.001+00:00</published><updated>2013-02-04T21:55:47.919+00:00</updated><title type='text'>Creating Authentic Looking Settings Panes with SettingsChrome</title><content type='html'>&lt;p&gt;In my &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/12/settings-panes-and-okra-app-framework.html&quot;&gt;last post&lt;/a&gt; I described how the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt; allows you easily add multi-page settings panes to your Windows Store applications using the MVVM pattern.&lt;/p&gt; &lt;p&gt;However, the built in Windows 8 applications have a very distinctive style of settings pane and many Windows Store applications will want to recreate this style. To aid with this the Okra App Framework provides a SettingsChrome control to recreate the standard UI chrome.&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB9j3wqCbsmo27vFPSoY2-5gzpvertTss-vrrKtusR571RDs2NRbkfmZEDGDVnI55JXDaSTn4SrZaVKnVveYTr1FLp3qGDWhy7O4xQ1ypVZIdWWMHeMz1QvetSI9zRIFO2Qwc5lssAhUA/s1600-h/SettingsPaneUI%25255B16%25255D.png&quot;&gt;&lt;img title=&quot;SettingsPaneUI&quot; style=&quot;border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; border-left: 0px; display: block; padding-right: 0px; margin-right: auto&quot; border=&quot;0&quot; alt=&quot;SettingsPaneUI&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWsRWA4gq4kxfLSfelYuhiFJBBrhJEqiGccG55-Vuk_hJFvKtClWHxis-Vn0QhQ6JkJaQso4iIrWU1ojGnraQCqvMSbOhKWs4RltI9RM_1egzmRnp3Wo0j6Q3hjl57ull08x-4f9js3ro//?imgmax=800&quot; width=&quot;350&quot; height=&quot;198&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Using the SettingsChrome control&lt;/h2&gt; &lt;p&gt;If you remember from previously, you define the UI for an Okra App Framework settings pane using a standard UserControl with the PageExportAttribute applied to it.&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[PageExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MySettings&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MySettingsPage : UserControl&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;In the XAML we can add the Okra SettingsChrome control as the first child element (this can be done either manually in the XAML or added in the designer). SettingsChrome is a content control, and anything that you add inside it will be displayed within the content region of the settings pane. Also you may wish to set the width of the UserControl to define the size of the resulting settings pane.&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;UserControl&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns:ui&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;using:Okra.UI&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;346&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ui:SettingsChrome&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Sample&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #ff0000&quot;&gt;Logo&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;ms-appx:///Assets/SmallLogo.png&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #ff0000&quot;&gt;BackButtonCommand&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;{Binding ...}&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #ff0000&quot;&gt;HeaderBackgroundBrush&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;{StaticResource ...}&quot;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #ff0000&quot;&gt;HeaderForegroundBrush&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;{StaticResource ...}&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&amp;lt;!-- Insert settings pane content here --&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ui:SettingsChrome&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;UserControl&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;There are a number of properties that you can set on SettingsChrome,&lt;/p&gt;&lt;ul&gt;&lt;li&gt;“Title” – This property allows you to set the text that is displayed at the top of the settings pane&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“Logo” – This should point to an image resource to use as the application logo in the top-right corner of the settings pane&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“BackButtonCommand” – This can be bound to a relevant command on the view-model and will be called whenever the user clicks on the settings pane back button&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“HeaderBackgroundBrush” – This allows you to set the background colour for the settings pane header. Generally this will be a static resource set to the same colour used for application tile background&lt;/li&gt;&lt;br /&gt;&lt;li&gt;“HeaderForegroundBrush” – This allows you to set the foreground colour for the settings pane header&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Summary&lt;/h2&gt;&lt;p&gt;To summarise, the Okra App Framework allows you to easily recreate the standard settings pane UI within your own application by simply adding a SettingsChrome control into the pane’s XAML.&lt;/p&gt;&lt;p&gt;A sample application demonstrating the use of SettingsChrome, as well as how to define a settings pane using MVVM is available from the &lt;a href=&quot;http://okra.codeplex.com/releases/view/98887&quot;&gt;Okra CodePlex downloads page&lt;/a&gt;.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/4630369088731444699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/4630369088731444699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4630369088731444699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4630369088731444699'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2013/02/creating-authentic-looking-settings.html' title='Creating Authentic Looking Settings Panes with SettingsChrome'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWsRWA4gq4kxfLSfelYuhiFJBBrhJEqiGccG55-Vuk_hJFvKtClWHxis-Vn0QhQ6JkJaQso4iIrWU1ojGnraQCqvMSbOhKWs4RltI9RM_1egzmRnp3Wo0j6Q3hjl57ull08x-4f9js3ro/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-5632982742199016755</id><published>2012-12-17T22:03:00.001+00:00</published><updated>2012-12-17T22:16:41.460+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><title type='text'>Settings Panes and the Okra App Framework</title><content type='html'>&lt;p&gt;In this post (the first of two) I will describe how you can use the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt; to add custom settings panes to your Windows Store application, in particular taking advantage of the MVVM pattern. In my following post I will show you how to easily design a settings UI consistent with the built-in Windows applications.&lt;/p&gt; &lt;p&gt;In Windows 8, application settings are available from any page of a running application by using the settings charm. This brings up a system-provided list of the available settings entry points, with application specific settings at the top (followed by the Windows provided “Permissions” and “Rate and review” items). If the user selects one of these application specified entry points it is the responsibility of the running application to provide the resulting settings UI.&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSGUDCvX1z4meOkshyhIdDXnznP284DHle0TvCZXrF7AoUa9AmtlCUrESi_EcES0VfveRkxQoS9sYdbka1qB8P2agsmL_2YGMTpK84W2ML4tVRh7QnuVjPBS8mrRESHUVpzi6gFwFT5DI/s1600-h/Settings-images7.png&quot;&gt;&lt;img title=&quot;Settings images&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; border-top-width: 0px; margin-right: auto&quot; border=&quot;0&quot; alt=&quot;Settings images&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheMe2oummbRMq5EO8tZDYcwLub9fMciYyW6mVNTyzrCAKNbfKKYpwCwZRmfD2-iadyF3oo2Xgju8WLM-daPJ44bgJrLZvsn_0WByfCs5O2W34SZFyIfKNGGqM3zf32FXZwK5hguOcEVOA//?imgmax=800&quot; width=&quot;240&quot; height=&quot;191&quot;&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Defining a Settings Pane with the Okra App Framework&lt;/h2&gt; &lt;p&gt;The Okra App Framework makes it simple to add custom settings panes, following the same pattern as any other page within an Okra based application. The framework takes care of displaying the correct UI and providing a dedicated navigation stack within the settings pane.&lt;/p&gt; &lt;p&gt;Any element may be used to define the settings UI, however a UserControl is most commonly used. This is tagged with a page name using the PageExport attribute in the code-behind file.&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[PageExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MySettings&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MySettingsPage : UserControl&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;If using the MVVM pattern, the view-model is similarly defined and attributed with the ViewModelExport attribute.&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;MySettings&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; MySettingsViewModel : ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;This is all that is required to define an MVVM based settings pane.&lt;/p&gt;&lt;h2&gt;Displaying the Settings Pane&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Whenever a user opens the settings pane, the currently running application is notified via the ‘SettingsPane.CommandsRequested’ event and asked to return the settings to display. In Okra based applications the recommended place to register for this event is in the SetupServices() method of the application bootstrapper. In the event handler you can add any number of settings commands in the order they are desired.&lt;/p&gt;&lt;p&gt;The Okra App Framework provides an ISettingsManager interface and default implementation to handle the resulting navigation to a settings pane. By calling the ‘NavigateTo(…)’ method the settings UI will be displayed in a slide-in pane at the edge of the screen.&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;interface&lt;/span&gt; ISettingsPaneManager : INavigationBase&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ShowSettingsPane();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;interface&lt;/span&gt; INavigationBase&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; CanGoBack { get; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    INavigationEntry CurrentPage { get; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;event&lt;/span&gt; EventHandler CanGoBackChanged;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; GoBack();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; NavigateTo(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; pageName);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; NavigateTo(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; pageName, &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; arguments);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;To make this even easier, the Okra App Framework provides a helper extension method on any INavigationBase instance named ‘GetNavigateToSettingsCommand(…)’ which takes as arguments the name to display to the user, and the page name we defined in the previous section. Therefore a typical bootstrapper will look as follows,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 600px; width: 97.5%; background-color: #f4f4f4&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; AppBootstrapper : OkraBootstrapper&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #008000&quot;&gt;// *** Imported Properties ***&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    [Import]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; ISettingsPaneManager SettingsPaneManager { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #008000&quot;&gt;// *** Overriden Base Methods ***&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SetupServices()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;// Register with Windows to display items in the settings pane&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width:180%;background-color: #f4f4f4&quot;&gt;        SettingsPane.GetForCurrentView().CommandsRequested += SettingsPane_CommandsRequested;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #008000&quot;&gt;// *** Private Methods ***&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SettingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #008000&quot;&gt;// Add each settings item in the order you wish them to appear&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;        args.Request.ApplicationCommands.Add(SettingsPaneManager.GetNavigateToSettingsCommand(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Settings&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&quot;MySettings&quot;&lt;/span&gt;));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 180%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;Navigation Within the Settings Pane&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Whilst in many cases a custom settings pane will self contained, multi-page settings are possible. Consider an “Accounts” setting where a link takes you to a further “Add account” settings page. This is fully supported in the Okra App Framework by calling the ISettingsPaneManager.NavigateTo(…) and .GoBack() methods to navigate between sections. In addition, calling ‘GoBack()’ on the first page in the navigation stack will redisplay the system provided settings list.&lt;/p&gt;&lt;h2&gt;Summary&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;To summarise, the Okra App Framework makes adding settings panes to your application simple. The steps are,&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create a UserControl with the desired UI and set the PageExport attribute.&lt;/li&gt;&lt;li&gt;Optionally add a view-model attributed with the ViewModelExport attribute.&lt;/li&gt;&lt;li&gt;In the application bootstrapper register for the SettingsPane.CommandsRequested event and use the GetNavigateToSettingsCommand(…) extension method to return a SettingsCommand.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;A sample application demonstrating custom settings panes is available from the &lt;a href=&quot;http://okra.codeplex.com/releases/view/98887&quot;&gt;Okra CodePlex downloads&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Of course it is up to you to provide a suitable UI for the displayed settings pane. In my next post I will describe how to use Okra’s SettingsChrome to present a UI consistent with the standard Windows experience.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/5632982742199016755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/5632982742199016755' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5632982742199016755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5632982742199016755'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/12/settings-panes-and-okra-app-framework.html' title='Settings Panes and the Okra App Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheMe2oummbRMq5EO8tZDYcwLub9fMciYyW6mVNTyzrCAKNbfKKYpwCwZRmfD2-iadyF3oo2Xgju8WLM-daPJ44bgJrLZvsn_0WByfCs5O2W34SZFyIfKNGGqM3zf32FXZwK5hguOcEVOA/s72-c/?imgmax=800" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-301131914004050332</id><published>2012-11-04T13:06:00.001+00:00</published><updated>2012-11-04T13:06:36.559+00:00</updated><title type='text'>Okra App Framework v0.9.5 Released</title><content type='html'>&lt;p&gt;The latest update to the Okra App Framework has just been released and is available from the Okra &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;CodePlex&lt;/a&gt; site and via &lt;a href=&quot;http://www.nuget.org/Packages/Okra.MEF&quot;&gt;NuGet&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;New Features in This Release&lt;/h2&gt; &lt;ul&gt; &lt;li&gt;Settings support&lt;/li&gt; &lt;ul&gt; &lt;li&gt;The framework now includes support for the Windows 8 settings charm. Custom application settings panes can be defined using the MVVM pattern and Okra will handle the wiring required to show the settings pane – I will write about this in detail in an upcoming blog post.&lt;/li&gt; &lt;li&gt;A SettingsChrome control is included to allow developers to easily match the settings UI of the default Windows 8 applications&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;The NavigationManager class has now been refactored to derive from a NavigationBase class with the base functionality. This allows the creation of custom navigation managers (for example the SettingsPaneManager)&lt;/li&gt; &lt;li&gt;Updated to support MEF v1.0.16&lt;/li&gt; &lt;li&gt;Minor improvements and bug fixes&lt;/li&gt;&lt;/ul&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/301131914004050332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/301131914004050332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/301131914004050332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/301131914004050332'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/11/okra-app-framework-v095-released.html' title='Okra App Framework v0.9.5 Released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-620862913173850512</id><published>2012-10-29T21:50:00.001+00:00</published><updated>2012-10-29T21:59:21.631+00:00</updated><title type='text'>App Search and the Okra App Framework</title><content type='html'>&lt;p&gt;One advantage of the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt; over other MVVM-based application frameworks is that it is designed from the ground up to work great with Windows 8. Over the next few versions this will become more evident as features are added to support the various Windows 8 system contracts – search, settings, sharing, etc.&lt;/p&gt; &lt;p&gt;In this post I will describe how the Okra App Framework makes it easy to add search to your application using the same MVVM principles that you are using for the rest of your application.&lt;/p&gt; &lt;h2&gt;The Search Contract in Windows 8&lt;/h2&gt; &lt;p&gt;When developing Windows Store applications many developers will want to take advantage of the Windows 8 search charm. This allows users to search across all applications from a single, consistent entry point. In order to add search functionality you would generally override the OnSearchActivated(…) method in the App.xaml.cs code-behind. In fact the standard Visual Studio search page template will add the code required to do this. For a great Windows Store application however you would want to,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Fully follow the Windows search design guidelines (available &lt;a href=&quot;http://msdn.microsoft.com/en-US/library/windows/apps/hh465233&quot;&gt;here&lt;/a&gt;)&lt;/li&gt; &lt;li&gt;Preserve the existing application state and correctly handle back navigation from the search page&lt;/li&gt; &lt;li&gt;Navigate to a suitable page (normally the application home page) if an empty search is performed&lt;/li&gt; &lt;li&gt;Improve performance by attaching to the SearchPane.QuerySubmitted event where possible&lt;/li&gt; &lt;li&gt;You may also want to implement the search page using the MVVM pattern&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;By simply using the Okra App Framework search manager it will take care of these requirements.&lt;/p&gt; &lt;h2&gt;Adding Search to Your Application with the Okra App Framework&lt;/h2&gt; &lt;p&gt;The Okra App Framework provides a search manager to handle the process of activating search in your application. This is represented by the ISearchManager interface,&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;interface&lt;/span&gt; ISearchManager&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; SearchPageName { get; set; }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;By default the SearchPageName property is set to null, and Okra will not handle search activation. To opt-in to the search integration you should set the page name for search in your application’s bootstrapper SetupServices() method.&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; AppBootstrapper : OkraBootstrapper&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SetupServices()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;        SearchManager.SearchPageName = &lt;span style=&quot;color: #006080&quot;&gt;&quot;Search&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;By adding this single line your application has been enabled for search, and a page named “Search” will be navigated to when the user performs a search within your application (note that you will also need to declare that your application supports search in the application manifest).&lt;/p&gt;&lt;h2&gt;Defining Your Search Page&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Because search uses the standard Okra page discovery mechanisms you define your search page and view-model as you would any other page within your application,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[PageExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Search&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; SearchPage : LayoutAwarePage&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Search&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; SearchViewModel : NotifyPropertyChangedBase, ISearchPage&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;One thing to note is that the search view model implements the ISearchPage interface (this could also be implemented by the page if you are not using the MVVM pattern),&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;interface&lt;/span&gt; ISearchPage&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; PerformQuery(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; queryText, &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; language);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This method will be called whenever the page should show a new set of search results. In this method you provide the application logic to perform the search operation and display the results to the user. Note that this may be called multiple times for a single page as the user performs subsequent searches and you should refresh the content with the new results.&lt;/p&gt;&lt;h2&gt;Summary&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;In the above discussion I have shown how the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framew&lt;/a&gt;ork makes it simple to implement search functionality in applications based on the MVVM pattern.&lt;/p&gt;&lt;p&gt;A sample search application is available from the &lt;a href=&quot;http://okra.codeplex.com/releases/view/96990&quot;&gt;Okra CodePlex downloads section&lt;/a&gt;. This is based on the Visual Studio search template, but modified to correctly implement the MVVM pattern.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/620862913173850512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/620862913173850512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/620862913173850512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/620862913173850512'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/10/app-search-and-okra-app-framework.html' title='App Search and the Okra App Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-422453132579873990</id><published>2012-09-05T22:11:00.001+01:00</published><updated>2012-09-05T22:18:27.499+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="Metro"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><title type='text'>Convention Based Page Discovery With The Okra App Framework</title><content type='html'>&lt;p&gt;One of the key features of the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt; for developing Windows 8 apps is the navigation framework with its support for the MVVM pattern. By default pages and view-models are marked with attributes so that the framework can locate them. In this post I will describe how you can enable an alternative convention based approach.&lt;/p&gt; &lt;h2&gt;The Default Attribute Based Approach&lt;/h2&gt; &lt;p&gt;When using the Okra App Framework navigation support all pages are represented by a page name. So that the framework can locate the associated pages and view-models these are normally attributed with either the PageExportAttribute or ViewModelExportAttribute respectively (for more information see &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/04/navigation-in-cocoon-mvvm-for-metro.html&quot;&gt;my previous post&lt;/a&gt;). For example for a page named “Foo” the classes would be attributed as,&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[PageExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Foo&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; FooPage : LayoutAwarePage&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Foo&quot;&lt;/span&gt;)]&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; FooViewModel&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;A Convention Based Approach&lt;/h2&gt;&lt;p&gt;Often however there will be a common naming pattern throughout the application. In the example above all pages are named XxxPage and view-models named XxxViewModel, where “Xxx” is the associated page name. In a convention based approach you no longer need to apply attributes to classes. Instead they are automatically discovered based on a common naming system.&lt;/p&gt;&lt;p&gt;Since the standard Okra bootstrapper uses MEF for composition (for example when using the &lt;a href=&quot;http://www.nuget.org/Packages/Okra.MEF&quot;&gt;Okra.MEF NuGet package&lt;/a&gt;), we can use the MEF convention based discovery. To enable this we need to add the following code to the application bootstrapper,&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; width: 97.5%; background-color: #f4f4f4&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; AppBootstrapper : OkraBootstrapper&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #008000&quot;&gt;// *** Overriden base methods ***&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;override&lt;/span&gt; ContainerConfiguration GetContainerConfiguration()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;    {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;        ConventionBuilder conventionBuilder = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; ConventionBuilder();&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;        conventionBuilder.ForTypesMatching(type =&amp;gt; type.FullName.EndsWith(&lt;span style=&quot;color: #006080&quot;&gt;&quot;Page&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;                         .Export(builder =&amp;gt; builder.AsContractType&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;&amp;gt;()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;                                                   .AsContractName(&lt;span style=&quot;color: #006080&quot;&gt;&quot;OkraPage&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;                                                   .AddMetadata(&lt;span style=&quot;color: #006080&quot;&gt;&quot;PageName&quot;&lt;/span&gt;, type =&amp;gt; type.Name.Substring(0, type.Name.Length - 4)));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;        conventionBuilder.ForTypesMatching(type =&amp;gt; type.FullName.EndsWith(&lt;span style=&quot;color: #006080&quot;&gt;&quot;ViewModel&quot;&lt;/span&gt;))&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;                         .Export(builder =&amp;gt; builder.AsContractType&amp;lt;&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt;&amp;gt;()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;                                                   .AsContractName(&lt;span style=&quot;color: #006080&quot;&gt;&quot;OkraViewModel&quot;&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;                                                   .AddMetadata(&lt;span style=&quot;color: #006080&quot;&gt;&quot;PageName&quot;&lt;/span&gt;, type =&amp;gt; type.Name.Substring(0, type.Name.Length - 9)));&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; GetOkraContainerConfiguration()&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;                .WithAssembly(&lt;span style=&quot;color: #0000ff&quot;&gt;typeof&lt;/span&gt;(AppBootstrapper).GetTypeInfo().Assembly, conventionBuilder);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: white&quot;&gt;    }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 200%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;With this code in place we can greatly simplify our page and view-model definitions to the following. Note that since we follow the convention we no longer need to add any attributes.&lt;/p&gt;&lt;div id=&quot;codeSnippetWrapper&quot;&gt;&lt;div id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;sealed&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; FooPage : LayoutAwarePage&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;&amp;nbsp;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; FooViewModel&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;{&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4&quot;&gt;    ...&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &#39;Courier New&#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white&quot;&gt;}&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Summary&lt;/h2&gt;&lt;p&gt;As I have shown, when using the &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;Okra App Framework&lt;/a&gt; navigation support you can simplify app development by using a convention based approach to defining pages and view-models for the MVVM pattern.&lt;/p&gt;&lt;p&gt;A sample application demonstrating this is available from the &lt;a href=&quot;http://okra.codeplex.com/releases/view/94066&quot;&gt;Okra CodePlex downloads&lt;/a&gt;.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/422453132579873990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/422453132579873990' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/422453132579873990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/422453132579873990'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/09/convention-based-page-discovery-with.html' title='Convention Based Page Discovery With The Okra App Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-2039391601285398275</id><published>2012-08-27T21:26:00.001+01:00</published><updated>2012-08-27T21:26:47.228+01:00</updated><title type='text'>Okra App Framework v0.9.4 Released</title><content type='html'>&lt;p&gt;Version 0.9.4 of the Okra App Framework is now available via &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;CodePlex&lt;/a&gt; and &lt;a href=&quot;http://www.nuget.org/Packages/Okra.MEF&quot;&gt;NuGet&lt;/a&gt;. Since the core functionality of the framework has been in testing for some time now I have removed the ‘beta’ suffix from the version number, with the benefit that the framework should show in the default NuGet feed.&lt;/p&gt; &lt;p&gt;Minimal changes and bug fixes were made in this release, with the key change being updating the Okra App Framework to work against the RTM version of MEF (v1.0.15).&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/2039391601285398275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/2039391601285398275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/2039391601285398275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/2039391601285398275'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/08/okra-app-framework-v094-released.html' title='Okra App Framework v0.9.4 Released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-8222132155205207891</id><published>2012-08-12T20:15:00.001+01:00</published><updated>2012-08-12T20:15:26.970+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cocoon"/><category scheme="http://www.blogger.com/atom/ns#" term="Metro"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Okra"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><title type='text'>Cocoon is now the Okra App Framework</title><content type='html'>&lt;p&gt;Today I would like to announce that the Cocoon framework is now know as the ‘Okra App Framework’. It still includes the great features previously available in the Cocoon framework, but from now onwards will be developed under the new name.&lt;/p&gt; &lt;h2&gt;&lt;/h2&gt; &lt;h2&gt;How to Get The Okra App Framework&lt;/h2&gt; &lt;p&gt;The ‘Okra App Framework’ CodePlex site is available at &lt;a href=&quot;http://okra.codeplex.com/&quot;&gt;http://okra.codeplex.com/&lt;/a&gt; (all previous code/downloads/discussions have been migrated from the old site, and any links to the previous URLs will redirect to their new location).&lt;/p&gt; &lt;p&gt;In addition there are two new NuGet packages,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href=&quot;https://www.nuget.org/packages/Okra.MEF&quot;&gt;“Okra App Framework”&lt;/a&gt; – This will be the package for most users and includes the MEF dependencies and the ‘OkraBootstrapper’ class.  &lt;li&gt;&lt;a href=&quot;https://www.nuget.org/packages/Okra.Core&quot;&gt;“Okra App Framework (Core only)”&lt;/a&gt; – For users who only require the core assembly.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you are using the Cocoon NuGet packages and wish to get future releases then you should use the NuGet package manager to uninstall Cocoon and then install the new Okra App Framework package.&lt;/p&gt; &lt;h2&gt;&lt;/h2&gt; &lt;h2&gt;Okra App Framework Release 0.9.3-beta&lt;/h2&gt; &lt;p&gt;Along with the name change a new version of the framework has been released via NuGet and the &lt;a href=&quot;http://okra.codeplex.com/releases/&quot;&gt;Okra App Framework CodePlex downloads page&lt;/a&gt;. The changes include,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Namespace changes from ‘Cocoon’ to ‘Okra’ and from ‘CocoonBootstrapper’ to ‘OkraBootstrapper’ (a simple find-and-replace in your project should solve any errors occurring from this). &lt;li&gt;Addition of a SearchManager that allows an easy, view-model centric, implementation of the Windows 8 Search contract (I will aim to detail this in a future blog post). &lt;li&gt;The ActivationManager class allows extensible handling of application activation (you can write activation handlers to handle any of the activation types). &lt;li&gt;Upgraded to MEF version 1.0.13-rc. &lt;li&gt;Removal of the previous obsoleted VirtualizingVector with the recommendation that VirtualizingVectorBase is used going forward (although if you still require VirtualizingVector it can be downloaded as part of any of the previous source releases and copied into your own projects).&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Why the Name Change?&lt;/h2&gt; &lt;p&gt;I recently received a message from a member of the Apache Software Foundation, informing me that they also have a web application framework named &lt;a href=&quot;http://projects.apache.org/projects/cocoon.html&quot;&gt;Apache Cocoon&lt;/a&gt;. To avoid any confusion that may arise between the two frameworks the best approach going forward was a name change.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/8222132155205207891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/8222132155205207891' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/8222132155205207891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/8222132155205207891'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/08/cocoon-is-now-okra-app-framework.html' title='Cocoon is now the Okra App Framework'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-5237223746671526815</id><published>2012-08-06T21:01:00.001+01:00</published><updated>2012-08-06T21:04:02.642+01:00</updated><title type='text'>Shell Based Navigation in Cocoon</title><content type='html'>I recently had a query in the &lt;a href=&quot;http://cocoon.codeplex.com/discussions&quot;&gt;Cocoon CodePlex forums&lt;/a&gt; regarding how to support an application shell when using the &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon framework&lt;/a&gt;’s navigation support. By default the Cocoon navigation framework will display pages full screen, with each navigation replacing the previous page with the next. There are some occasions however where it makes sense to have an application shell that takes up the full screen, with the page navigation occurring in a region within this.&lt;br /&gt;
&lt;br /&gt;
A typical example would consist of a fixed region dedicated to navigation at the top of the screen, with the page content filling below. The end result looks like,&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzsMydceAdZIzO4x8r5_jd0OjJK3ITIXjiOn8qzMgBu7oeAGnvNQGxlS5zYNAoravYfzJguyLik9E-2RZEcier8QgCiFoHv3hWqlIIIJ4KFLSOH0jSNmokciU7ax0V-5Gc2nIgxzb1jtI/s1600-h/image%25255B11%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;250&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh18HwyhjCkasPTRDQM9UiHuzD_O2QWBFWNwGdRG1PE-IOsanrpxFM2fuICzeP-Pvpzgyx_vdboIzXJ2JUrQvLrNTj1drB0DSzpPgCcgX13Pi-Px7jB_3ORieAG0wqAlgRhce3EEeBFxcU//?imgmax=800&quot; style=&quot;background-image: none; border: 0px currentColor; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;/h2&gt;
&lt;h2&gt;
Creating an Application Shell in Cocoon&lt;/h2&gt;
The key to creating an application shell in Cocoon is the INavigationTarget interface. This has only a single method named NavigateTo(…). When implemented by an application, any calls to the navigation framework will result in a call to this method with the page to display. The framework itself will handle the creation and wiring up of views and view-models, the navigation stack, persistence and other aspects of navigation.&lt;br /&gt;
In our example application we will use the MVVM pattern to define our application shell, hence we have a ShellViewModel,&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; [Export(&lt;span style=&quot;color: blue;&quot;&gt;typeof&lt;/span&gt;(INavigationTarget))]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt; [Shared]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; ShellViewModel : NotifyPropertyChangedBase, INavigationTarget&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;// *** Fields ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; content;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; ShellPage shellPage;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;// *** Properties ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; Content&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt;         get&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum15&quot; style=&quot;color: #606060;&quot;&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum16&quot; style=&quot;color: #606060;&quot;&gt;  16:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; content;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum17&quot; style=&quot;color: #606060;&quot;&gt;  17:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum18&quot; style=&quot;color: #606060;&quot;&gt;  18:&lt;/span&gt;         set&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum19&quot; style=&quot;color: #606060;&quot;&gt;  19:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum20&quot; style=&quot;color: #606060;&quot;&gt;  20:&lt;/span&gt;             &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (content != &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum21&quot; style=&quot;color: #606060;&quot;&gt;  21:&lt;/span&gt;             {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum22&quot; style=&quot;color: #606060;&quot;&gt;  22:&lt;/span&gt;                 content = &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum23&quot; style=&quot;color: #606060;&quot;&gt;  23:&lt;/span&gt;                 OnPropertyChanged();&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum24&quot; style=&quot;color: #606060;&quot;&gt;  24:&lt;/span&gt;             }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum25&quot; style=&quot;color: #606060;&quot;&gt;  25:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum26&quot; style=&quot;color: #606060;&quot;&gt;  26:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum27&quot; style=&quot;color: #606060;&quot;&gt;  27:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum28&quot; style=&quot;color: #606060;&quot;&gt;  28:&lt;/span&gt;     &lt;span style=&quot;color: green;&quot;&gt;// *** INavigationTarget Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum29&quot; style=&quot;color: #606060;&quot;&gt;  29:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum30&quot; style=&quot;color: #606060;&quot;&gt;  30:&lt;/span&gt;     &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; NavigateTo(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; page)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum31&quot; style=&quot;color: #606060;&quot;&gt;  31:&lt;/span&gt;     {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum32&quot; style=&quot;color: #606060;&quot;&gt;  32:&lt;/span&gt;         &lt;span style=&quot;color: green;&quot;&gt;// If this is the first navigation then create the shell view and bind to this view model&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum33&quot; style=&quot;color: #606060;&quot;&gt;  33:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum34&quot; style=&quot;color: #606060;&quot;&gt;  34:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (shellPage == &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum35&quot; style=&quot;color: #606060;&quot;&gt;  35:&lt;/span&gt;         {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum36&quot; style=&quot;color: #606060;&quot;&gt;  36:&lt;/span&gt;             shellPage = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ShellPage();&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum37&quot; style=&quot;color: #606060;&quot;&gt;  37:&lt;/span&gt;             shellPage.DataContext = &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum38&quot; style=&quot;color: #606060;&quot;&gt;  38:&lt;/span&gt;         }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum39&quot; style=&quot;color: #606060;&quot;&gt;  39:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum40&quot; style=&quot;color: #606060;&quot;&gt;  40:&lt;/span&gt;         &lt;span style=&quot;color: green;&quot;&gt;// Set the content for the shell to the specified page&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum41&quot; style=&quot;color: #606060;&quot;&gt;  41:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum42&quot; style=&quot;color: #606060;&quot;&gt;  42:&lt;/span&gt;         &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Content = page;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum43&quot; style=&quot;color: #606060;&quot;&gt;  43:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum44&quot; style=&quot;color: #606060;&quot;&gt;  44:&lt;/span&gt;         &lt;span style=&quot;color: green;&quot;&gt;// Set the shell view as the window content&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum45&quot; style=&quot;color: #606060;&quot;&gt;  45:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum46&quot; style=&quot;color: #606060;&quot;&gt;  46:&lt;/span&gt;         Window.Current.Content = shellPage;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum47&quot; style=&quot;color: #606060;&quot;&gt;  47:&lt;/span&gt;     }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum48&quot; style=&quot;color: #606060;&quot;&gt;  48:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
The ShellViewModel exposes a single property named ‘Content’ that will contain the page to display and will be bound to in the view. In our NavigateTo(…) method we firstly determine if we have created the associated view and create this is necessary. We then set the ‘Content’ property to the supplied page and this ensure that the view is displayed in the window. Finally we mark the class as a shared export of INavigationTarget using the MEF attributes. Note that since we will never be navigating explicitly to the shell then we do not need to decorate this with a ViewModelExport attribute.&lt;br /&gt;
&lt;br /&gt;
In the sample code the shell view model also exposes a ‘GoBackCommand’ that allows you to include a back navigation button within the shell region.&lt;br /&gt;
&lt;br /&gt;
The ShellPage.xaml file contains the view for the application shell. This simply contains the required elements for the upper portion of the screen, with a ContentControl bound to the view models ‘Content’ property. It is within this ContentControl that the pages will be displayed. The key elements are shown below,&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum1&quot; style=&quot;color: #606060;&quot;&gt;   1:&lt;/span&gt; &amp;lt;Grid Style=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;{StaticResource LayoutRootStyle}&quot;&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum2&quot; style=&quot;color: #606060;&quot;&gt;   2:&lt;/span&gt;     ...&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum3&quot; style=&quot;color: #606060;&quot;&gt;   3:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum4&quot; style=&quot;color: #606060;&quot;&gt;   4:&lt;/span&gt;     &amp;lt;!-- Back button and page title --&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum5&quot; style=&quot;color: #606060;&quot;&gt;   5:&lt;/span&gt;     &amp;lt;Grid&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum6&quot; style=&quot;color: #606060;&quot;&gt;   6:&lt;/span&gt;         &amp;lt;Grid.ColumnDefinitions&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum7&quot; style=&quot;color: #606060;&quot;&gt;   7:&lt;/span&gt;             &amp;lt;ColumnDefinition Width=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Auto&quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum8&quot; style=&quot;color: #606060;&quot;&gt;   8:&lt;/span&gt;             &amp;lt;ColumnDefinition Width=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;*&quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum9&quot; style=&quot;color: #606060;&quot;&gt;   9:&lt;/span&gt;         &amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum10&quot; style=&quot;color: #606060;&quot;&gt;  10:&lt;/span&gt;         &amp;lt;Button x:Name=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;backButton&quot;&lt;/span&gt; .../&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum11&quot; style=&quot;color: #606060;&quot;&gt;  11:&lt;/span&gt;         &amp;lt;TextBlock x:Name=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;pageTitle&quot;&lt;/span&gt; .../&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum12&quot; style=&quot;color: #606060;&quot;&gt;  12:&lt;/span&gt;     &amp;lt;/Grid&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum13&quot; style=&quot;color: #606060;&quot;&gt;  13:&lt;/span&gt;     &amp;lt;ContentControl Content=&lt;span style=&quot;color: #006080;&quot;&gt;&quot;{Binding Content}&quot;&lt;/span&gt; .../&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span id=&quot;lnum14&quot; style=&quot;color: #606060;&quot;&gt;  14:&lt;/span&gt; &amp;lt;/Grid&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
When the application is run the NavigationManager will automatically locate the INavigationTarget through the MEF export and direct all navigation through this.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Summary&lt;/h2&gt;
I have shown above how you can implement an application shell using the Cocoon framework. The sample application with full source code is available from the &lt;a href=&quot;http://cocoon.codeplex.com/releases/view/91893&quot;&gt;Cocoon CodePlex downloads&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/5237223746671526815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/5237223746671526815' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5237223746671526815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5237223746671526815'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/08/shell-based-navigation-in-cocoon.html' title='Shell Based Navigation in Cocoon'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh18HwyhjCkasPTRDQM9UiHuzD_O2QWBFWNwGdRG1PE-IOsanrpxFM2fuICzeP-Pvpzgyx_vdboIzXJ2JUrQvLrNTj1drB0DSzpPgCcgX13Pi-Px7jB_3ORieAG0wqAlgRhce3EEeBFxcU/s72-c/?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-6185780383577603091</id><published>2012-07-24T21:26:00.001+01:00</published><updated>2012-07-24T21:26:52.644+01:00</updated><title type='text'>Cocoon Framework v0.9.2 Released</title><content type='html'>&lt;p&gt;As I discussed in my &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/06/cocoon-now-available-on-nuget.html&quot;&gt;previous post&lt;/a&gt; on NuGet support in the Cocoon framework, I will be distributing major updates within the framework as new releases. Today I am pleased to say that version 0.9.2 is available from both the &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon CodePlex site&lt;/a&gt; and downloadable &lt;a href=&quot;http://www.nuget.org/packages/Cocoon.MEF&quot;&gt;directly from NuGet&lt;/a&gt;.&lt;/p&gt; &lt;h2&gt;New Features in This Release&lt;/h2&gt; &lt;p&gt;This release has mainly focussed upon updates to the Cocoon data framework. In particular,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Significant improvements in how the data framework handles caching of list items.&lt;/li&gt; &lt;li&gt;Infrastructure added to support change notifications for data lists.&lt;/li&gt; &lt;li&gt;The ‘PagedDataListSource’ class now includes a ‘PageCacheSize’ property that allows you to specify the maximum number of pages to hold in memory at any one time (by default all pages are stored).&lt;/li&gt; &lt;li&gt;Introduction of an ‘IncrementalLoadingDataList’ class. This supports the Windows 8 Metro &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh701916.aspx&quot;&gt;ISupportIncrementalLoading&lt;/a&gt; interface. This allows a data bound UI to download a small subset of a large list of items, with further items being retrieved and added when the user scrolls to the end of the list.&lt;/li&gt; &lt;li&gt;A Refresh() method has been added to SimpleDataListSource and PagedDataListSource. This allows you to clear the internal cache and re-fetch any data that may have changed. Any attached data lists will automatically update to reflect the changes.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Some improvements to the navigation framework include,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Updated to support MEF version 1.0.11-rc.&lt;/li&gt; &lt;li&gt;Changes to the ‘CocoonBootstrapper’ to help with a convention based approach to exporting pages and view models (I will write a blog post on this in the future).&lt;/li&gt; &lt;li&gt;The navigation manager now exposes a ‘CurrentPage’ property so that you can programmatically determine the currently displayed page and associated information.&lt;/li&gt; &lt;li&gt;Pages and view-models can now be named by specifying a type as an alternative to a string page name.&lt;/li&gt; &lt;li&gt;A MEF sharing boundary (named “page”) has been placed around each page and view model pair (see &lt;a href=&quot;http://mef.codeplex.com/wikipage?title=Sharing%20and%20lifetime&quot;&gt;here&lt;/a&gt; for more information on MEF sharing boundaries).&lt;/li&gt; &lt;li&gt;Some common MVVM base classes have been included. Whilst you are not restricted to using these to take advantage of the Cocoon framework they provide basic functionality that is common to many applications. These classes include,&lt;/li&gt; &lt;ul&gt; &lt;li&gt;DelegateCommand and DelegateCommand&amp;lt;T&amp;gt; – implementations of the ICommand interface that allow you to bind UI interactions to methods on your view models.&lt;/li&gt; &lt;li&gt;NotifyPropertyChangedBase – provides a simple base class for view models that supports property change notification.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;A number of other bug fixes.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Breaking Changes&lt;/h2&gt; &lt;p&gt;Unfortunately there are a small number of breaking changes in this release. For most developers however the changes should be minimal.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;‘SpecialPageNames.HomePage’ has been renamed ‘SpecialPageNames.Home’.&lt;/li&gt; &lt;li&gt;The contract for IDataListSource has changed. Note that this should only affect developers who are writing custom IDataListSource implementations. If you are using SimpleDataListSource or PagedDataListSource then existing code should not be affected. In particular the changes are,&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Addition of an IndexOf(…) method to the IDataListSource interface.&lt;/li&gt; &lt;li&gt;The data list source implementations are now fully responsible for caching of data.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;The ‘InternalList’ property of ‘DataListSourceBase’ has been removed (derived classes should create their own internal cache) and the corresponding property in ‘SimpleDataListSource’ and ‘PagedDataListSource’ has been made private.&lt;/li&gt; &lt;li&gt;VirtualizingVector&amp;lt;T&amp;gt; is now marked as Obsolete – it is recommended that you use the data list support or the new VirtualizingVectorBase&amp;lt;T&amp;gt;.&lt;/li&gt;&lt;/ul&gt; &lt;h2&gt;Getting the Latest Version of Cocoon&lt;/h2&gt; &lt;p&gt;To get the latest release of the Cocoon framework the best place to start is using the NuGet package manager to download the “Cocoon Framework” package (see &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/06/cocoon-now-available-on-nuget.html&quot;&gt;here&lt;/a&gt; for more information). If you are already using Cocoon via NuGet then you should be able to update your solution to the latest version directly through the NuGet package manager.&lt;/p&gt; &lt;p&gt;Alternatively the source code is available via the &lt;a href=&quot;http://cocoon.codeplex.com/releases/&quot;&gt;Cocoon CodePlex downloads page&lt;/a&gt;. As always the latest interim code drops are also available from CodePlex under the source code tab.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/6185780383577603091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/6185780383577603091' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/6185780383577603091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/6185780383577603091'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/07/cocoon-framework-v092-released.html' title='Cocoon Framework v0.9.2 Released'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-3560698074353943077</id><published>2012-06-26T22:36:00.001+01:00</published><updated>2013-03-24T16:48:34.200+00:00</updated><title type='text'>Cocoon Now Available on NuGet</title><content type='html'>&lt;b&gt;Update : The &#39;Cocoon&#39; framework is now named the &#39;Okra App Framework&#39;. For information on how to obtain the framework via NuGet then see the documentation &lt;a href=&quot;http://okra.codeplex.com/wikipage?title=Downloading%20the%20Okra%20App%20Framework&amp;referringTitle=Documentation&quot;&gt;here.&lt;/a&gt;&lt;/b&gt;

&lt;hr/&gt;

I am very pleased to announce that the &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon framework&lt;/a&gt; is now available via NuGet (thanks to Brendan Forster for helping to get this off the ground). Going forward this will be the recommended source when using the framework in your own projects.&lt;br /&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;h2&gt;

Getting Cocoon Via NuGet&lt;/h2&gt;
With the release of Visual Studio 2012, the NuGet package manager is included within the product. This means that to reference the Cocoon framework all you need to do is to right-click on the project’s “References” folder and select “Manage NuGet Packages…”&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_gultHgEe385FHyTpm9so3ULUoz9K3al-zuatni-ObjsHuAGOiDJSc1WZnQfVtC7Fi24tT333WhIEC_cXjuRmIRI4r1oG8m-533cI12AiqkSdW_PiTmYvz0eqJRBhWdKqkOQ0tlbr9Y0/s1600/NuGet+Menu+Option.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_gultHgEe385FHyTpm9so3ULUoz9K3al-zuatni-ObjsHuAGOiDJSc1WZnQfVtC7Fi24tT333WhIEC_cXjuRmIRI4r1oG8m-533cI12AiqkSdW_PiTmYvz0eqJRBhWdKqkOQ0tlbr9Y0/s320/NuGet+Menu+Option.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Note that since the Cocoon framework is currently pre-release then you should select “Include Prerelease” in the box highlighted in red below. You can then search for “Cocoon”.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_vJku_ij2auTsnjL89roKeig6t4y005gzlWpRcwFRvGwEhrx4fE2bCPk1yQqatGJ1nejx8kwWC-jDpGfl_q8Hov6fKXmWxNutq5Qofrk4vgtoSt6uRYd73JHAv7f3369b1DqIT7ioZv4/s1600/NuGet+Cocoon+Packages.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_vJku_ij2auTsnjL89roKeig6t4y005gzlWpRcwFRvGwEhrx4fE2bCPk1yQqatGJ1nejx8kwWC-jDpGfl_q8Hov6fKXmWxNutq5Qofrk4vgtoSt6uRYd73JHAv7f3369b1DqIT7ioZv4/s400/NuGet+Cocoon+Packages.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Note that there are currently two packages for the Cocoon framework. In general you should select the package named “Cocoon Framework” as this includes the complete framework including the MEF based bootstrapper. Clicking install will then download Cocoon along with any dependencies and add these to your project.&lt;br /&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;h2&gt;

Updating Your Project to the Latest Version Of the Cocoon Framework&lt;/h2&gt;
One of the advantages of using NuGet to distribute the Cocoon framework is that it makes it very easy to upgrade projects to the latest version of the framework. To do this simply open the package manager for a project that you have previously added Cocoon via NuGet and select the “Updates” tab. Any updated packages will be displayed and can be upgraded with a single click.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgupnN2c4icAOwJTl4DcyS_tvzbQuc4ZjJCyS9XDesIDeq2eeH0P19_hnz0iLLRzE0FoJmos9Nq883UFFn6EMbZoalj91z7DVwN1Ih3FJ07PXqQcAQaso6ZCe92A0KKm3yNIZq6E2FSGY8/s1600/NuGet+Cocoon+Updates.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgupnN2c4icAOwJTl4DcyS_tvzbQuc4ZjJCyS9XDesIDeq2eeH0P19_hnz0iLLRzE0FoJmos9Nq883UFFn6EMbZoalj91z7DVwN1Ih3FJ07PXqQcAQaso6ZCe92A0KKm3yNIZq6E2FSGY8/s400/NuGet+Cocoon+Updates.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;

Note: Making the Cocoon Framework Independent of Composition Container&lt;/h2&gt;
I have had a number of queries from developers who wish to use alternative composition containers with the Cocoon framework. Whilst it is recommended for most projects that you use the provided MEF composition implementation, with this latest release the Cocoon framework can now be used with any other composition container. The project has been split into two assemblies,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Cocoon – contains the core framework independent of composition container.  &lt;/li&gt;
&lt;li&gt;Cocoon.MEF – contains the MEF dependencies (most importantly the MEF based “CocoonBootstrapper”).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;

How Will Cocoon be Released in the Future?&lt;/h2&gt;
Going forward there will be three ways to obtain the Cocoon framework,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;NuGet: This is the recommended source and will contain the latest stable versions. If I discuss any functionality on this blog then it will be implemented in the latest NuGet release unless otherwise stated.  &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cocoon.codeplex.com/releases/&quot;&gt;CodePlex Downloads&lt;/a&gt;: I will also provide a zipped package of the source code via CodePlex in the Cocoon downloads section. This will be kept in sync with the NuGet releases.  &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cocoon.codeplex.com/SourceControl/list/changesets&quot;&gt;CodePlex Source Control&lt;/a&gt;: For those interested in the very latest versions of Cocoon then this will be available as always via the “Source Code” tab of the Cocoon CodePlex site. Note however that this may include experimental functionality and may not be stable.&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/3560698074353943077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/3560698074353943077' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/3560698074353943077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/3560698074353943077'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/06/cocoon-now-available-on-nuget.html' title='Cocoon Now Available on NuGet'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_gultHgEe385FHyTpm9so3ULUoz9K3al-zuatni-ObjsHuAGOiDJSc1WZnQfVtC7Fi24tT333WhIEC_cXjuRmIRI4r1oG8m-533cI12AiqkSdW_PiTmYvz0eqJRBhWdKqkOQ0tlbr9Y0/s72-c/NuGet+Menu+Option.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-4349951767731668187</id><published>2012-06-06T22:08:00.001+01:00</published><updated>2012-06-06T22:08:32.873+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cocoon"/><category scheme="http://www.blogger.com/atom/ns#" term="MEF"/><category scheme="http://www.blogger.com/atom/ns#" term="Metro"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><title type='text'>Cocoon Updated for Windows 8 Release Preview</title><content type='html'>&lt;p&gt;You will be pleased to hear that I have just pushed an updated version of the Cocoon framework onto CodePlex that supports the Windows 8 Release Preview.&lt;/p&gt; &lt;p&gt;As usual the code is freely available for download from the &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon CodePlex site&lt;/a&gt; (to get the latest version go to the “Source Code” tab, select the first change set and use the “Download” link). &lt;/p&gt; &lt;h2&gt;Using MEF in the Release Preview&lt;/h2&gt; &lt;p&gt;As many of you will be aware, the Cocoon framework uses the Managed Extensibility Framework (MEF) by default for locating and composing applications. With the release of the Windows 8 Release Preview, MEF is not being distributed separately – for more details see the &lt;a href=&quot;http://blogs.msdn.com/b/bclteam/archive/2012/05/30/mef-and-tpl-dataflow-nuget-packages-for-net-framework-4-5-rc.aspx&quot;&gt;announcement on the BCL team blog&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;You will therefore need to add MEF as a reference to your application via NuGet. The above link has more details however the steps are,&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Right click on your projects ‘References’ folder and select “Manage NuGet Packages…”&lt;/li&gt; &lt;li&gt;Select “Online” in the left-hand pane and make sure that you have “Include Prerelease” selected rather then “Stable Only” at the top.&lt;/li&gt; &lt;li&gt;Use the search box to search for “MEF”&lt;/li&gt; &lt;li&gt;Select “MEF for web and Metro style apps” and click “Install”&lt;/li&gt;&lt;/ol&gt; &lt;h2&gt;Changes in tHis Release of Cocoon&lt;/h2&gt; &lt;p&gt;In general most applications should not be affected by the changes in this version of Cocoon (apart for the fact that they will run on the Release Preview!). Changes of interest include,&lt;/p&gt; &lt;ul&gt; &lt;li&gt;All use of MEF has been modified to support the new version&lt;/li&gt; &lt;li&gt;The ‘CocoonBootstrapper’ no longer has an overridable GetPartCatalog() method and is replaced with GetContainerConfiguration().&lt;/li&gt; &lt;li&gt;The ISupportPlaceholder interface has been removed in the Release Preview. The VirtualizingVector&amp;lt;T&amp;gt; implementation has been updated to reflect these changes and now returns ‘null’ as a placeholder (as now expected by the standard XAML controls).&lt;/li&gt; &lt;li&gt;Many other updates and bug fixes&lt;/li&gt;&lt;/ul&gt;  </content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/4349951767731668187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/4349951767731668187' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4349951767731668187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4349951767731668187'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/06/cocoon-updated-for-windows-8-release.html' title='Cocoon Updated for Windows 8 Release Preview'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-4049612100847102570</id><published>2012-05-29T19:25:00.001+01:00</published><updated>2012-06-03T11:17:50.857+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cocoon"/><category scheme="http://www.blogger.com/atom/ns#" term="Metro"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><title type='text'>Cocoon Navigation – Making Your App “Always Alive”</title><content type='html'>Over the last few posts I have discussed the navigation framework that is included as part of the freely available &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon framework&lt;/a&gt; for developing Metro-style Windows 8 applications in .Net languages. I have shown &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/04/navigation-in-cocoon-mvvm-for-metro.html&quot;&gt;how to annotate pages to be discovered by the framework&lt;/a&gt; and &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/05/cocoon-navigation-passing-arguments.html&quot;&gt;how to pass arguments between pages&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
In this post I will discuss one of the benefits of using the Cocoon framework to manage your application’s navigation.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


Making Your Application “Always Alive”&lt;/h2&gt;
One of the challenges when writing Windows 8 Metro-style applications is to manage the application lifecycle. So that Windows is able to ensure a great experience for users running on battery powered devices, Metro style apps are suspended as the user moves to other applications. Furthermore, your application may be terminated to free more memory if this is required. However for the end user great Metro-style applications will give the impression that they are “always alive” in the background. It is up to you, the developer, to ensure that this illusion is maintained. For more background Microsoft’s Windows 8 Application Developer blog has &lt;a href=&quot;http://blogs.msdn.com/b/windowsappdev/archive/2012/04/10/managing-app-lifecycle-so-your-apps-feel-quot-always-alive-quot.aspx&quot;&gt;a great post on this topic&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
One aspect of making your application feel “always alive” is to ensure that if it is terminated and later relaunched then the user is taken to exactly the same point that they were previously viewing. To do this you must persist the navigation stack, currently viewed page and any page state then subsequently restore this.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


Persisting Navigation With the Cocoon Framework&lt;/h2&gt;
The great news is that if you are using the Cocoon navigation framework then this is all handled automatically for you. All you have to do is enable this by setting the INavigationManager.NavigationStorageType property. Typically you would set this by overrinding the SetupNavigationManager() method in your application bootstrapper (&lt;a href=&quot;http://andyonwpf.blogspot.com/2012/05/getting-started-with-cocoon-navigation.html&quot;&gt;see this post for more information on the bootstrapper&lt;/a&gt;),&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; AppBootstrapper : CocoonBootstrapper&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Overriden base methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;override&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; SetupNavigationManager()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        NavigationManager.NavigationStorageType = NavigationStorageType.Local;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
There are currently three possible NavigationStorageType values,&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;None – Your navigation state will not be persisted and your application will always launch to your home page.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;Local – Your navigation state will be persisted to the current machine only.&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;Roaming – Your navigation state will be persisted between all devices that the user logs into using their Microsoft Account.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
That’s all you need to do, Cocoon will handle everything else – persisting the navigation stack, restoring to the correct page, storing the arguments passed to each page.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


Preserving Page State&lt;/h2&gt;
In some cases you may want to go a step further and store some page state. Imagine for example you are half way through writing a comment in a social networking app, then change app to do something else. When you return you should expect that you can continue from where you left off. Other things you may want to preserve are selected search filters, selected items, position in a view, etc.&lt;br /&gt;
&lt;br /&gt;
Preserving page state can be done by the view model implementing the IActivatable&amp;lt;TArguments, TState&amp;gt; interface that &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/05/cocoon-navigation-passing-arguments.html&quot;&gt;I discussed last time for passing arguments to pages&lt;/a&gt;. The TState generic type can be set to the data type you would like to persist (TArguments can be set to ‘string’ if it is not required).&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;interface&lt;/span&gt; IActivatable&amp;lt;TArguments, TState&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Activate(TArguments arguments, TState state);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    TState SaveState();&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
On first navigation to the page the Activate(…) method will be called passing the default value of TState (‘null’ for string or reference types). When Cocoon determines that it should preserve page state then it will call the SaveState() method and your implementation should return the current state. If the application is later terminated and relaunched then a new instance of the view model is created and activated by calling the Activate(…) method with the preserved state.&lt;br /&gt;
&lt;br /&gt;
For example, if as part of a hypothetical photo browsing app we allow the user to comment on a photo we could implement the view model as,&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;ViewPhoto&quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; ViewPhotoViewModel : IActivatable&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, ViewPhotoState&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Properties ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Comment&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        get { ... }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        set { ... }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    ...&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** IActivatable Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Activate(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; arguments, ViewPhotoState state)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Photo = GetPhoto(arguments);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (state != null)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;            ViewPhotoState viewState = (ViewPhotoState)state;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;            &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Comment = viewState.Comment;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; ViewPhotoState SaveState()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ViewPhotoState() { Comment = &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Comment };&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Sub-classes ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    [DataContract]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; ViewPhotoState&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        [DataMember]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; Comment;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Note that we store the state as a custom ‘ViewPhotoState’ object that is decorated to allow serialization by the DataContractSerializer.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;


Summary&lt;/h2&gt;
&lt;br /&gt;
I have shown above how we can easily make our applications feel “always alive” by using the Cocoon navigation framework.&lt;br /&gt;
&lt;br /&gt;
As usual the code is freely available for download from the &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon CodePlex site&lt;/a&gt; (to get the latest version go to the “Source Code” tab, select the first change set and use the “Download” link).</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/4049612100847102570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/4049612100847102570' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4049612100847102570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/4049612100847102570'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/05/cocoon-navigation-making-your-app.html' title='Cocoon Navigation – Making Your App “Always Alive”'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8838794302949839825.post-5874101766289996240</id><published>2012-05-20T20:28:00.001+01:00</published><updated>2012-05-20T20:32:31.630+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cocoon"/><category scheme="http://www.blogger.com/atom/ns#" term="Metro"/><category scheme="http://www.blogger.com/atom/ns#" term="MVVM"/><category scheme="http://www.blogger.com/atom/ns#" term="Navigation"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows 8"/><title type='text'>Cocoon Navigation – Passing Arguments Between Pages</title><content type='html'>Over the last couple of posts I have introduced the navigation framework that is included as part of the freely available &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon framework&lt;/a&gt; for developing Metro-style Windows 8 applications. I have &lt;a href=&quot;http://andyonwpf.blogspot.com/2012/04/navigation-in-cocoon-mvvm-for-metro.html&quot;&gt;previously shown&lt;/a&gt; how to annotate pages with the PageExport and ViewModelExport attributes, and to navigate to these using the INavigationManager.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;

Passing Arguments to ViewModels&lt;/h2&gt;
Whilst navigating between pages is a common pattern for modern applications, often you wish to pass some state during page navigation. As an example, imagine a photo browsing application. The “BrowsePhotos” page may show a number of images, which when clicked on navigates to a “ViewPhoto” page. In this case there needs to be some way to pass the image to display as an argument to the “ViewPhoto” page.&lt;br /&gt;
&lt;br /&gt;
This is made simple in the Cocoon navigation framework by a second overload of the INavigationManager.NavigateTo(…) method that takes both a page name and an argument to pass between the pages.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;interface&lt;/span&gt; INavigationManager&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    ...&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; NavigateTo(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; pageName);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; NavigateTo(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; pageName, &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; arguments);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
The ‘arguments’ parameter can be of any type, however there are a number of restrictions that should be observed in practice,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The type should be able to be serialized via a DataContractSerializer&lt;/li&gt;
&lt;br /&gt;
&lt;li&gt;The type should not rely on a reference to any particular object (for example if the value is from a shared cache it may be better to pass the key rather than the actual object to ensure that multiple versions are not created)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
In our photo application example we are caching the image details, so pass the photoID from the “BrowsePhotos” view model,&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;BrowsePhotos&quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; BrowsePhotosViewModel&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Fields ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;readonly&lt;/span&gt; INavigationManager navigationManager;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Constructors ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    [ImportingConstructor]&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; BrowsePhotosViewModel(INavigationManager navigationManager)&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.navigationManager = navigationManager;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Command Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; ViewPhoto(Photo photo)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        navigationManager.NavigateTo(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;ViewPhoto&quot;&lt;/span&gt;, photo.PhotoId);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;

Activating Destination Pages&lt;/h2&gt;
The destination view model is able to accept parameters by implementing the IActivatable&amp;lt;TArguments, TState&amp;gt; interface where the type of the argument is designated by TArguments. The TState generic type will be discussed in a later blog post and if not required can be set as ‘string’.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;interface&lt;/span&gt; IActivatable&amp;lt;TArguments, TState&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Activate(TArguments arguments, TState state);&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    TState SaveState();&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
After creating the new view model the Cocoon framework will call the Activate(…) method passing in the argument passed from the call to INavigationManager.NavigatedTo(…). This method will only be called once and prior to display of the view.&lt;br /&gt;
&lt;br /&gt;
In our example photo browsing application the “ViewPhoto” view model will therefore be implemented as (Note that the unused SaveState() method simply returns ‘null’),&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;[ViewModelExport(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;ViewPhoto&quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; ViewPhotoViewModel : IActivatable&amp;lt;&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;{&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    ...&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** IActivatable Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Activate(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; arguments, &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; state)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Photo = GetPhoto(arguments);&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; SaveState()&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: green;&quot;&gt;// *** Private Methods ***&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; Photo GetPhoto(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; photoId)&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    {&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;        ...&lt;/pre&gt;
&lt;pre style=&quot;background-color: white; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;    }&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f4f4f4; color: black; direction: ltr; font-family: &amp;quot;Courier New&amp;quot;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding: 0px; text-align: left; width: 100%;&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;

Summary&lt;/h2&gt;
&lt;br /&gt;
I have describe above how the Cocoon framework makes passing arguments between pages simple to implement. Over the next posts I will discuss some of the added value when using the Cocoon navigation framework, including how to make your application seem “always alive”.&lt;br /&gt;
&lt;br /&gt;
As usual the code is freely available for download from the &lt;a href=&quot;http://cocoon.codeplex.com/&quot;&gt;Cocoon CodePlex site&lt;/a&gt; (to get the latest version go to the “Source Code” tab, select the first change set and use the “Download” link).</content><link rel='replies' type='application/atom+xml' href='http://andyonwpf.blogspot.com/feeds/5874101766289996240/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8838794302949839825/5874101766289996240' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5874101766289996240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8838794302949839825/posts/default/5874101766289996240'/><link rel='alternate' type='text/html' href='http://andyonwpf.blogspot.com/2012/05/cocoon-navigation-passing-arguments.html' title='Cocoon Navigation – Passing Arguments Between Pages'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/10117584978862298252</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>