Couldn't get ZoomCanvas to work

Jan 14, 2011 at 8:18 AM

What I understood is that : the ZoomCanavas Control is a content control which will only take one child , I assume that this child must be a container control to hold your controls, I assumed also this container control must be put in a ZoomCanvasItem control , what I want to do is to give my controls the ability to scale , rotate etc ..  beside the functionality the ZoomCavas provide, here is my XAML which it didn't work for the ZoomCanvas part

 

<b:ZoomCanvas Grid.Row="1" Background="Blue">
            <b:ZoomCanvasItem>
            <s:ScatterView>
                <s:ScatterViewItem>
                    <Image Source="C:\8.jpg"/>
                </s:ScatterViewItem>
            </s:ScatterView>
            </b:ZoomCanvasItem>
        </b:ZoomCanvas>
Thanks for everything Mr. Joshua
Coordinator
Jan 14, 2011 at 8:24 AM

Your understanding is basically correct.

I'm not sure what exactly is keeping your code from working, but you shouldn't need to include the <b:ZoomCanvasItem> in there. Just put the ScatterView directly inside the ZoomCanvas. Did you take a look at the Blake.NUI.TestApplication project? Look in TestApplication.Common/Views/MainWindowView.xaml.

Jan 14, 2011 at 9:12 AM
Edited Jan 14, 2011 at 9:22 AM

Thanks, It did work now , it was about ZoomCanvasInputAdapterTouch which I don't really know what is it here for ? , the only thing come to my mind is there is a differences between Windows7 touch and Surface touch I guess , here is the working XAML

 

<b:ZoomCanvas Grid.Row="1" Background="Blue">
            <b:ZoomCanvas.InputAdapter>
                <touch:ZoomCanvasInputAdapterTouch />
            </b:ZoomCanvas.InputAdapter>
            <s:ScatterView>
                <s:ScatterViewItem>
                    <Image Source="C:\8.jpg"/>
                </s:ScatterViewItem>
                </s:ScatterView>
        </b:ZoomCanvas>

 

Thanks again

Coordinator
Jan 14, 2011 at 9:15 AM

Oops, oh yeah. I forgot to mention the InputAdapter. That features allows you to use the same ZoomCanvas for Surface SDK and WPF 4, or conceptually with other types of inputs. It abstracts the zooming logic from the input SDKs or platform.