Search Unity

Using more xaml page with unity

Discussion in 'Windows' started by Freeubi, Mar 9, 2016.

  1. Freeubi

    Freeubi

    Joined:
    May 30, 2014
    Posts:
    21
    Hello,

    i want to use some native elements for the UI/Control (mostly buttons, textboxes etc).
    Thats ok, i can add the elements to the xaml and use it, but i have 2 different unity scene where the ui is different.

    I tried to copy the default mainpage and navigate to that, but the unity is not rendering on the second page -
    can someone help me to find a solution? Or this cant be done?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,736
    This can not be done. Unity can only be initialized once on a particular screen.
    You have to replace your XAML controls on the same page.
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    You can do it if you add the same swapchainpanel to the new page too.
     
  4. Freeubi

    Freeubi

    Joined:
    May 30, 2014
    Posts:
    21
    So (basically), i need to make a SwapChainPanel global variable to the App.xaml.cs and use that?

    I know, that this is not the correct unity usage and i can build with one page also (change which ui is visible based on the scene loaded) but this would be awesome in a few different way :)
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Or just grab the one from the MainPage. Either way should work.
     
  6. Freeubi

    Freeubi

    Joined:
    May 30, 2014
    Posts:
    21
    Unfortunately i can't make it work, its not drawing onto the second swapchainpanel.

    Anyway, thanks for your help, i will try it later :)