microsoft / WindowsCompositionSamples

The Windows Composition Samples have moved here: https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/SceneGraph
https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/SceneGraph
MIT License
1.12k stars 287 forks source link

Question #68

Closed santiagotactivos closed 8 years ago

santiagotactivos commented 8 years ago

Hi!

I'm Santiago Montero a developer from MURAL. We are trying to get our hands on the Composite API to improve performance in our product. We have tried it out already and we have a few questions.

To give some context of our needs, I wanted to show you what we are working on. "MURAL for Windows" is a UWP written in C# and XAML. It's a multi-platform app that allow teams to collaborate adding different types of content (sticky notes, inking, images, SVGs, links, etc) in a zoomable and pannable canvas. Here is an example:

7af19d9c-e5cf-407e-908d-9bb16b676e30

We currently use a ScrollViewer with multiple UIElements (grids/stackpanels/texblocks, inkcanvas, even webviews) as children of a Grid, which is the content of it. Our main concern right now with it is that the ScrollViewer, it is not as responsive as we need it to be and we want to handle touch events differently.

The problems we have with ScrollViewer are these:

So, I've been through a bunch of composite samples, and we wanted you to give us a hint on this:

Thank you, Santiago

pgills commented 8 years ago

@santiagotactivos There's a lot to unpack for this question so we'll try to answer some in parts if possible.

For the last known good configuration you can see our wiki. Currently, the most stable Insider Build + SDK is 14295.

For manipulations and gestures you can start with this article on Touch Interactions. It does cover some of the manipulation events that you can leverage with UIElements. Note that these API's are focused around UIElements. Also keep in mind that your customers will also have other inputs like mouse and keyboard so ensure that your interactions are inclusive.

Also I would try to use a combination of those APIs with the ScrollViewer to try to achieve your desired experience. We have lower level API's that connect input and Composition Objects together, however, they are more lower level in the aspects that you'll essentially start to implement your own custom ScrollViewer. However, if you start going down that route, you'll definitely need to start thinking more about input as you'll loose that inclusive input handling if you move away from ScrollViewer. @likuba for FYI on input.

Currently the pattern for hosting Composition content within XAML:

That content visual content will render over top of the XAML content. Currently there's no true "mixing" where you could directly host XAML content within a Composition Visual.

Hopefully, that article will be a good starting point.

likuba commented 8 years ago

@santiagotactivos

If you want to investigate more customized scrolling feel free to start by watching this build talk: https://channel9.msdn.com/Events/Build/2016/P405

As Paul mentioned, you will lose the ease of use that ScrollViewer provides as this API is lower level, but it will allow you more control/customization over your manipulations.

santiagotactivos commented 8 years ago

Thank you both Paul and Lindsay! That's awesome!

pgills commented 8 years ago

Cleaning up issues.