Strange behavior of the border control with MultiTouchBehavior

Feb 7, 2011 at 1:44 AM

Hi,

I want to have a border around image, so i create a border control, and put an image inside it. Then i attach MultiTouchBehavior to border control. The problem is that i cannot control the size of the border. For example in the program i write something like this:

border1.Height = 128;

and it works, but a soon as i start moving the border control the size became 200x200. Also in design mode, i can make border control as big (small) as i want, but when i start the program the size became 200x200.

So does MultiTouchBehavior work with border or maybe i did something wrong?

Feb 12, 2011 at 9:39 PM

I also found another problem with landscape orientation

when you add this code: SupportedOrientations = SupportedPageOrientation.Portrait | SupportedPageOrientation.Landscape;

and rotate phone, and then try to move element in horizontal direction, it will be moving in vertical.

Feb 13, 2011 at 2:23 PM

Hi becoolmax,

thanks for the feedback.

At this time the only supported orientation is Portrait, Landscape should be added in a next release.

Regarding the border control please try to follow the Behavior usage available in the sample contained in the download.

If you encounter any problem please send me a project reproducing the issue.

Thanks,

Davide 

Feb 20, 2011 at 8:38 PM

Hi davidezordan,

sorry for delay, download the project that reproduce the issue here: http://rapidshare.com/files/448997335/SilverlightWP7MultiTouchSample_bug.zip

First press the "Button"  and after that try to move the image with the red border and you will see the problem

Also i think i found  another issue:

if i attach event handler before attaching multitouch behavior to an object like this:

new_canvas.MouseLeftButtonDown += new MouseButtonEventHandler(new_canvas_MouseLeftButtonDown);

//****************************
//adding multitouch behaviors
var multiTouchBehavior = new MultiTouchBehavior()
{
IsScaleEnabled = true,
IsInertiaEnabled = false,
AreFingersVisible = true,
IsPivotEnabled = false,
IsRotateEnabled = true,
IsDebugModeActive = false
};
System.Windows.Interactivity.Interaction.GetBehaviors(new_canvas).Add(multiTouchBehavior);

multiTouchBehavior.Move(new Point(this.ActualWidth / 2, this.ActualHeight / 2), 0, 75);
//****************************

it works perfectly. However if i attach event handler after  attaching mutitouch behavior like this:


//****************************
//adding multitouch behaviors
var multiTouchBehavior = new MultiTouchBehavior()
{
IsScaleEnabled = true,
IsInertiaEnabled = false,
AreFingersVisible = true,
IsPivotEnabled = false,
IsRotateEnabled = true,
IsDebugModeActive = false
};
System.Windows.Interactivity.Interaction.GetBehaviors(new_canvas).Add(multiTouchBehavior);

multiTouchBehavior.Move(new Point(this.ActualWidth / 2, this.ActualHeight / 2), 0, 75);
 //****************************

new_canvas.MouseLeftButtonDown += new MouseButtonEventHandler(new_canvas_MouseLeftButtonDown);

then attached event (new_canvas_MouseLeftButtonDown) will not be triggered.

 

Feb 20, 2011 at 10:02 PM

Hi becoolmax,

thank for reporting these issues.

I'll add them as work items to do.

Thanks,

Davide

Feb 20, 2011 at 10:02 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 20, 2011 at 10:03 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.