Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

[Not Quite Solved] Can't successfully continue from WP8.1 File Picker

Discussion in 'Windows' started by bJam, Jan 7, 2015.

  1. bJam

    bJam

    Joined:
    Sep 4, 2013
    Posts:
    10
    So in my game I want to be able to pick a file and, for now, just return the path. WP8.1 has its own file picker as exemplified by this project and I've been trying to merge that functionality into a Unity WP8.1 app and it almost works!

    I can open up the file picker without any problems but it falls at the last hurdle i.e. triggering
    ContinueFileOpenPicker() on MainPage.xaml.cs. From stepping through it tells me that the root frame of the current window or that of the main page is always null at OnActivated() on App.xaml.cs so the continuation manager doesn't do anything (if frame = null then return).

    And it's there I'm stuck. Why is the root frame always null? It's not null on a normal WP8.1 app so it must be something that Unity is getting up to. Plz halp =(
     
  2. bJam

    bJam

    Joined:
    Sep 4, 2013
    Posts:
    10
    So, with thanks to carlosricardocm for posting his issue and thanks to Tomas for helping him out there, this problem has been solved =)

    Once Tomas' multiple pages example has been implemented in WP8.1 it's fairly simple to use the file picker. What I'll do is write a blog post once I've cleaned up my code explaining exactly how to get it working and post it here. Essentially the continuation manager must get the frame from StartPage but the continuation event needs to stay on MainPage. Somehow, getting the frame of StartPage returns the control content of MainPage. Happy days =)
     
  3. bJam

    bJam

    Joined:
    Sep 4, 2013
    Posts:
    10
    So a little update. The file picker works but it's incredibly unstable, but only while not debugging. While debugging the file picker always works as intended. When not debugging the file picker's stability turns sporadic. Sometimes the entire app will crash about 5 seconds after opening the file picker, other times the app continues absolutely fine. I can't for the life of me figure out what's wrong, I don't really know where to go in finding out because I can't debug the crash. I'll upload the project as a zip for anyone who wants to give it a shot.

    Build from Unity into the folder WP81C#2
     

    Attached Files: