WindowsCommunityToolkit icon indicating copy to clipboard operation
WindowsCommunityToolkit copied to clipboard

A CanvasView Control

Open enghch opened this issue 9 years ago • 15 comments

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

enghch avatar Jan 28 '17 06:01 enghch

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

hermitdave avatar Jan 28 '17 08:01 hermitdave

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

hermitdave avatar Jan 28 '17 08:01 hermitdave

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 avatar Jan 28 '17 16:01 enghch

@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.

Odonno avatar Jan 28 '17 21:01 Odonno

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

ScottIsAFool avatar Jan 28 '17 21:01 ScottIsAFool

@ScottIsAFool Yeah! That is one possible example.

Odonno avatar Jan 28 '17 22:01 Odonno

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.

enghch avatar Jan 29 '17 17:01 enghch

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

deltakosh avatar Jan 31 '17 19:01 deltakosh

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.

enghch avatar Jan 31 '17 19:01 enghch

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

deltakosh avatar Jan 31 '17 19:01 deltakosh

Thanks! Tweets are on the way! :)

enghch avatar Jan 31 '17 19:01 enghch

Whats the status? Can we archive/close it?

gbarcho avatar Jun 28 '18 13:06 gbarcho

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.

michael-hawker avatar Apr 11 '19 21:04 michael-hawker

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...

michael-hawker avatar Apr 02 '20 16:04 michael-hawker

Will be moving this to the discussion as that will our new platform for all the older discussions that still requires clarity and further input.

Kyaa-dost avatar Feb 02 '21 00:02 Kyaa-dost