Windowscommunitytoolkit: A CanvasView Control

Created on 28 Jan 2017  路  14Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

I find myself writing this control over and over in various projects and it's never vey good. I'd love a control that would be a sibling to ListView or GridView only it was backed by a 2D Canvas instead of an ItemsStackPanel. The control should allow the placement of rectangular items in 2D, allow the user to select items, drag them around and resize them. (An optional bonus would be to allow the user to rotate the items.) The control should allow panning and zooming. The look and content of the items should, of course, be customizable.

Uservoice link: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/17902486-a-canvasview-control

controls feature request help wanted

All 14 comments

I think @jamesmcroft created one and mentioned it in #490 maybe he can comment

Either way we are going to open uservoice in coming days and we can let community help us prioritise ideas and requests

Thanks! Yeah, #490 does look a lot like what I was imagining. I will go comment on that issue as well. I would love to submit this as a UserVoice request. Just so I don't forget, here are my various use cases:

1) I want to enable my users to tag faces and other things in an image. I want to let them stretch out a rectangular selection (or multiple selections) overlaying the image.

2) I want to create an hourly schedule control to imitate Outlook or the Calendar app. This would require selectable rectangular regions but they would not be in a stack (because multiple appointments can overlap).

3) I would like to let users create a Digital Scrapbook by dragging, rotating and stretching images just like in #490.

4) I would like to create a visualization of an AudioGraph where each node is a selectable rectangle. The nodes can be dragged around to rearrange them.

5) I would like to create a family pedigree chart where each person in the family is represented by a "card" control. Each person can be selected to show more information.

@enghch I suppose that all your use cases can be achieved using the Canvas control. So I think that your question is not about a new control but on all the possible ways to achieve more use cases easily using the Canvas control. Each child of the Canvas could have these attached properties :

  • Drag & Drop properties
  • Rotation properties
  • Stretching properties
  • Touch properties ? (like selection)
  • Ink properties ? (like selection or writing)

I know that's a totally different solution. I would be really happy if we can simplify the Drag & Drop.

Simplifying drag and drop, you mean like this https://metronuggets.com/2016/08/29/introducing-dropfilesbehaviour/?

@ScottIsAFool Yeah! That is one possible example.

Yeah, that's a good solution too, @ScottIsAFool and @Odonno. When you say "rotation properties" or "stretching properties" are you referring to using behaviors? If all the items in your list were easy-to-add behaviors that played together well then I think that's a great solution.

Hey @enghch !
In order to evaluate if a feature can be added to the toolkit we created a new category on WPDEV Uservoice: https://wpdev.uservoice.com/forums/110705-universal-windows-platform?query=A%20CanvasView%20Control
image

Can you please create an entry for your idea? based on upvote we will be able to know if this is something we can add to the toolkit!
Thank you very much

OK, thanks! I've got it recorded here: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/17902486-a-canvasview-control

We can close this issue now if you'd like.

I'll keep it open. Please start socializing it :)

Thanks! Tweets are on the way! :)

Whats the status? Can we archive/close it?

Not sure about all the interactive elements, but agree just a general helper to utilize Canvas for layout of items would be useful. Going to add to 6.0 for now to think about more later. I've done some initial testing with doing this with ItemsControl and using a Style setter binding helper.

Moving out of 6.1, think this needs a bit more clearer definition if it's just an ItemsControl using Canvas to help layout items or something more detailed...

Was this page helpful?
0 / 5 - 0 ratings