Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

How can I pin multiple XAML objects from a UWP app?

A UWP app can run on Hololens unaltered and the user can pin the app. I'm not sure what level that would happen, but it seems you'd have a spatial anchor and a quaternion associated with the Page. Can I create additional XAML UI objects, say a Grid or Canvas that are pinned into the environment separate from the main app itself? I'd assume this is the case, but I haven't seen it specifically addressed in the online documentation. I'm thinking in terms of say a grid containing status and queue information that could be pinned over the printer I'm looking at across the room right now.

If this is the case, is there a list of which XAML controls can be placed into the holographic environment?

Tagged:

Best Answer

Answers

  • @Brandon said:
    A UWP 2D app running on HoloLens runs as 2D projection on a frame that can be moved around the environment. From the app's perspective, it doesn't have any knowledge of how that frame is positioned in the environment. The 2D app doesn't have access to the spatial features -- the shell is doing all of this work.

    If you want access to spatial features like anchors, the app needs to have a holographic view (which means it's no longer limited to 2D). XAML only works in the 2D mode -- there is no XAML support within a holographic view. So when using XAML, you'll only be drawing 2D. XAML is still useful for holographic apps -- for instance, the keyboard uses this view.

    Do you expect a XAML app to be able to 3D aware at a future point? It seems to me that there would be a tremendous number of cases where a 2D XAML based pane would be useful. Most HUD type information makes sense in 2D. The character stats hovering over a D&D character don't need to be more than a 2D pane.

    I've heard many executives say, "A Windows 10 app is a holographic app", but if gaze, spatial mapping and the other holographic functions aren't exposed to the app, that statement is incorrect. Your execs should be saying "A Windows 10 app can run on Hololens, but isn't a holographic app."

  • The precise phrase is, "All holograms are UWP apps, and all UWP apps can be made into holograms." The path for an existing 2D app to become fully holographic and use features like spatial mapping is to add a holographic view. Right now XAML doesn't provide any way to present UI in holographic view. I can't comment on the future.

    As for the design point you're suggesting of a HUD, this is referred to as head locked or display locked content. This is bad and you don't want to do this as it makes your app experience uncomfortable for users.

    Some documentation pages worth reading:

  • I did not suggest anything be head-locked. I suggested that a spatial anchor and quaternion be associated with a XAML page/grid/canvas, I want to be clear on that. "HUD" was a poor choice of wording on my part. As an example, if I walk past a painting of Van Gogh's Sunflowers I want to pin a video of Van Gogh and Dr. Who on one side and a textual summary on the other. That doesn't require the XAML element to be 3D aware, just to have a position and orientation associated with it so it can be rendered in the correct place.

  • @DougF said:
    A UWP app can run on Hololens unaltered and the user can pin the app.
    ...
    Can I create additional XAML UI objects, say a Grid or Canvas that are pinned into the environment separate from the main app itself?
    ...
    I'm thinking in terms of say a grid containing status and queue information that could be pinned over the printer I'm looking at across the room right now.

    @DougF with 2D UWP apps one option that I have explored with some success in the emulator is the Multi-view capability of UWP apps to create secondary view windows with the ApplicationViewSwitcher and CreateNewView apis.

    Those apis make creating secondary pinable windows a fairly easy task. The thing that didn't work for us with this approach (which isn't just a HoloLens limitation) was that UWP creates those secondary views on their own separate threads in
    secondary CoreApplicationView objects which unfortunately do not work with a single main ViewModel. In our case we have a need to bind all of our windows (primary and secondary) to a single centralized ViewModel. The ViewModel propertychange events blow up every time a property changes if secondary views are bound to that property.

    So.. if you can get by without databinding on those secondary views, or at least settle for binding independently to disconnected view models, I believe you can create a UWP 2D experience where a single app allows you to pin a "window" with a video on one side of a painting and a "window" with a text summary on the other.

    Here are a few links to get you started down that path:

    Be two places at once using multiple windows.

    Show multiple views for apps

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

Sign In or Register to comment.