locked
custom flyout or dialog accessable throughout the application

    Question

  • Hi there

    I would like to create a fairly complicated custom dialog box which has a listview using a  template containing some complex touch controls to manipulate data.

    I'd like to know how I can make a custom flyout universally available throughout the application, the examples I've seen of flyouts all have the flyout declared somewhere in HTML and then made visible through the .winControl.show(myFlyOut) method. Since my application has numerous pages this approach doesn't suit me since any HTML is only available on the page it's written in and isn't on other pages I navigate to.

    I suppose one possible approach is to use javascript to the add the elements programmatically but I was wondering if there is not a better way or if I'm missing something obvious? 

    Wednesday, November 28, 2012 2:46 PM

Answers

  • In theory, if you use a PageControlNavigator in your "default.html" to manage your page transitions, any HTML object that you define on the "default.html" file will be available to any page navigated using the PageControlNavigator.

    You could create the Flyout in the "default.html" and access if from any other page (if you navigated to it using the PageControlNavigator).

    • Proposed as answer by got.dibbs Wednesday, December 5, 2012 2:54 PM
    • Marked as answer by Syllogism Wednesday, December 5, 2012 3:12 PM
    Friday, November 30, 2012 4:49 AM

All replies

  • In theory, if you use a PageControlNavigator in your "default.html" to manage your page transitions, any HTML object that you define on the "default.html" file will be available to any page navigated using the PageControlNavigator.

    You could create the Flyout in the "default.html" and access if from any other page (if you navigated to it using the PageControlNavigator).

    • Proposed as answer by got.dibbs Wednesday, December 5, 2012 2:54 PM
    • Marked as answer by Syllogism Wednesday, December 5, 2012 3:12 PM
    Friday, November 30, 2012 4:49 AM
  • Have you thought about using a page fragment in order to centralize where you store the HTML? That would likely solve your problem. You're loading the page programmatically, but it is stored centrally. The example from the SDK: http://code.msdn.microsoft.com/windowsapps/Fragments-91f66b07
    Monday, December 3, 2012 5:20 PM
  • I tried this but it doesn't seem to work, even though I'm using page fragments on certain pages(like search results) the page cannot be found.

    Monday, December 3, 2012 5:37 PM
  • my way around this has been to just build up the elements in javascript... not very pretty
    Tuesday, December 4, 2012 3:06 PM
  • Could you clarify how you've tried to implement what Ealsur suggested?

    You should be able to definte the html elements in your default.html file, and then reference them from your child page via something like document.getElementById("flyout") ... is that how you tried it?

    I can validate that I've done this several of times myself, so if you give us a bit more information we may be able to get that methodology to work for you as well.

    Wednesday, December 5, 2012 4:44 AM
  • HAH!!! I just found out what I was doing wrong...! 

    My application requires a login and then navigates to dynamicContainer.html on success, I thought it would be best to put my code in dynamicContainer.html but then it disappeared when I went to search. So I put it in default.html and now it works... not too smart :D

    Wednesday, December 5, 2012 8:01 AM