This project is read-only.

Windows Phone 8 support

Nov 28, 2012 at 9:44 PM

Hi Andy,

Have you considered porting this framework to Windows Phone 8?  I ask because I really like this framework and intend to attempt a port, if you haven't started already.  If you have or are planning to, can you give me some insights as to where the risk or targeted changes would need to be?

Thanks

Nov 29, 2012 at 1:19 PM

Hi,

Good to hear that you like the framework - Windows Phone 8 support is something that I'd like to add, and have discussed this with other Okra users. At the moment I've not had the time to look into this though, with work on the core Okra framework taking priority when I do get chance (I also don't think my current dev PC will support the WP8 emulator and without a WP8 device this would be interesting!).

I know some other users have looked into porting the parts of Okra that they require across to the phone platform (I'll ask them to post here to continue this discussion in the open). My first thoughts on the areas for change would be,

  • Activation: Ensuring that all the entry points go to the right pages.
  • Suspension and state handling (LifetimeManager): Exactly when and how state is persisted may need to be tweaked a bit for WP8.
  • Data classes: I don't think that the WP8 list controls have the same support for virtualization that W8 has so these might need more work.

If I get chance I'll look into this a bit also.

Regards,

    Andy

Nov 29, 2012 at 9:43 PM

Hi,

I have begun the task of porting parts of the Okra Framework for WP8. So far I have separated everything out into separate WinRT/WP8 assemblies with as much shared code as possible through Portable Class Libraries. Important classes to be shared like MEF attributes and common interfaces used in view models are all located in PCL libraries. UI specific classes are linked between WinRT/WP8 projects and uses preprocessor directives for including different namespaces etc.

This all works now and I have started looking into the activation and navigation model. I ran into some problems with the navigation model since WP navigation is quite tied to URIs and the PhoneApplicationFrame (with its own back navigation stack and for back button support).

Perhaps I can create a fork here for Okra WP8 support with the work done so far, for others to look at and contribute to. Interested?

Regards,

Joel

Nov 29, 2012 at 10:07 PM

Hi again,

I have now created a WP8 fork for interested to have a look at. It contains the shared structure so far for both WinRT and WinPRT (WP8). Navigation support is the thing I'm currently trying out in order to figure out a way to support all WP8 navigation scenarios, where many are URI based. The physical back navigation button is also something that must be handled properly. Both application life cycle and navigation is on the test bed and in my thoughts and not something ready to commit. I happily accept ideas here though.

/ Joel

Nov 30, 2012 at 12:18 AM

Hi Joel,

Thanks for starting this effort!!  

My initial suggestion would be in to possibly use the fully qualified type name of the View instance as the Uri, I've done this before for WP7 and will look at that code for other insights.  I'll be setting up my machine tomorrow with the SDK and will get your fork and take a look.

Thanks again,

Marlon 

Nov 30, 2012 at 7:21 AM

Hi,

I've experimented a little with two different models, one URI based, similar to what you describe, similar to the UriBuilder and how it's done in Caliburn Micro. This however gives you far less control over the navigation, compared to if it's handled by Okra itself, thus making it possible to save/restore navigation history etc.

I'm now looking at a model very similar to how it's done in Okra for WinRT today, navigating to a single RootPage in a PhoneApplicationFrame and then simply changing content in that page, thus hosting the real pages in that root page, where the rootpage "inherits" all properties from the child pages, like appbar, orientation, issytemtrayvisible, etc. This makes the navigation almost identical to the Okra Framework where both pages and viemodels can be created and stitched together by MEF. Do you see any negative sides to this?

I will try to implement this quite fast this weekend and perhaps push it into the fork for you to have a look at.

Regards,

Joel

Nov 30, 2012 at 8:59 AM

Hi,

Custom navigation model implemented and pushed to WP8 fork, similar to Okra for WinRT, where a single RootPage is navigated to in PhoneApplicationFrame. This RootPage is then hosting all other pages navigated to, thus the creation of views/viewmodels are all handled by IoC (MEF) and the navigation stack is completely under Okra control.

Please give it a try!

The WP8 app life cycle model now must be mapped to the WinRT app life cycle model in order for tombstoning etc to work as expected. I'll hopefully be able to look into this soon.

Nov 30, 2012 at 10:52 PM

Hi again,

I have now pushed some updated to the app life cycle model also making the corresponding suspend/resume events work also. I'm now successfully sharing about 95% of my view model code between my Windows Store app and the corresponding WP8 app. It seems to work, but I have not tested that many scenarios and only in the WP8 emulator.

Please let me know if you run into any problems with it.

Hopefully this code, or something similar can make it into the Okra standard release very soon. Of course some more testing must be done! Andy?

Regards,

Joel

Dec 3, 2012 at 1:07 PM

Hi Joel,

Thanks for all the work on the WP8 port. I've had a browse over the code and it looks a great start. The fact that you can share so much view model code between Win8 and WP8 versions is very promising.

I've been investigating the WP8 application model a bit myself and it looks like the changes from WP7 are quite minor. Do you know whether there would be any issues with targeting Okra for both versions with the same binaries, or would they need a separate compiles? I'm partly thinking about myself testing a WP version if I incorporate it into the main Okra release - I currently can't run the WP8 emulator and don't have access to a device :-(

Thanks again for all the good work,

    Andy

Dec 3, 2012 at 7:49 PM
Hi,

No problem at all, only glad I could contribute!

I guess you are very right, it shouldn't be a problem targeting WP7.1 in general since the navigation and application life cycle model (with events and all) is the same. The problem might be that MEF does perhaps does not exist for WP7 though, if that's what you want to use in the bootstrapper. The PCL of MEF is named portable-net45+win8 as a folder, not sure if that limits it to WP8 or not. I added the references to a WP7 project and it did compile so maybe that works!

One issue is that async/await and Task (TPL) is not available in WP7.1, even if the Async CTP Lib is available, though not as feature complete, and references to that will collide with same classes in WP8. WeakReference is also missing. So in order to target both WP7.1 and WP8 new projects better be added targeting WP7 specicially with additional external references and workarounds added.

Other things to consider in Okra for Phone is added support for, which I'll be looking into is the new WP8 language support, set on RootFrame, look in standard App.cs file for a new WP8 project and you'll see what I mean. Navigating into app from other souces, like pinned tiles, extensions in hubs, through application URI launches, etc.

That's my thoughts on the subject...

Regards,

Joel

On Mon, Dec 3, 2012 at 2:08 PM, AndyWilkinson <notifications@codeplex.com> wrote:

From: AndyWilkinson

Hi Joel,

Thanks for all the work on the WP8 port. I've had a browse over the code and it looks a great start. The fact that you can share so much view model code between Win8 and WP8 versions is very promising.

I've been investigating the WP8 application model a bit myself and it looks like the changes from WP7 are quite minor. Do you know whether there would be any issues with targeting Okra for both versions with the same binaries, or would they need a separate compiles? I'm partly thinking about myself testing a WP version if I incorporate it into the main Okra release - I currently can't run the WP8 emulator and don't have access to a device :-(

Thanks again for all the good work,

Andy

Read the full discussion online.

To add a post to this discussion, reply to this email (okra@discussions.codeplex.com)

To start a new discussion for this project, email okra@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Dec 5, 2012 at 10:23 AM

Hi,

I'd forgotten that the async stuff wasn't in WP7. Ideally I'd like to stick with MEF for the default IoC so this might be an issue with the WP7 port. Either way it looks like there would need to be seperate WP8 and WP7 projects in addition to the core Win8 one. One of my aims in setting up Okra was to take advantage of the latest OS features in Win8 without being constrained by legacy support - so maybe sticking to WP8 for now would be the best plan.

Andy

Dec 5, 2012 at 4:16 PM

Andy & Joel,

First, thank you both for moving forward with this so quickly.  Personally, I  think scoping this effort to only include WP8 is prudent, as the applications models shared by W8/WinRT and WP8/WinPRT are more likely to converge. 

Thanks again,

Marlon

Dec 11, 2012 at 7:15 PM

Now when I got the chance to try it on a real device I noticed that it would not deploy, complained about invalid assemblies referenced. I noticed that the MEF PCL assemblies was not targeted against Windows Phone 8, which made it work in the emulator but not on a real device. When I compiled the MEF assemblies myself adding support to all five PCL projects, now also targeting WP8, it worked fine, so hope fully they will release a new NuGet version soon.

I have added an issue on the MEF project for this, please vote this up.

http://mef.codeplex.com/workitem/14603

 

Regards,

Joel

Dec 11, 2012 at 10:09 PM

Joel,

That's a shame that there are issues with the MEF PCL and Windows Phone 8. Whilst Okra is designed so that it supports any composition container, it would be nice to have a baseline MEF implementation across all supported platforms. I've voted up your MEF work-item.

Andy

Dec 11, 2012 at 11:48 PM
Edited Dec 11, 2012 at 11:48 PM

Same here, hopefully we'll see a response soon.

Marlon