Rotate button outside page

Feb 27, 2012 at 9:48 AM

Hello all,

I'm trying to place the rotatebutton outside the document. (Next to the page navigator).

Can't seem to get it to work because the rotatebutton doesn't call the behavior LayoutRotateBehavior behavior any more .



(So the rotate button must be placed outside the controltemplate).

 

Also: Is there a way to get te current page only?

(MainPage.xaml.cs doesn't recognise AssociatedObject).

 

Thanks in advance!

Gr,

Nick

Coordinator
Feb 28, 2012 at 1:48 PM

Hi Nick,

You can't use the current LayoutRotateBehavior for this. If you want to rotate on a per-page basis and move the button outside the page template, you need to create a custom LayoutRotateBehavior. You can re-use parts of the current behavior, but you need to remove the button and make the Angle a Dependency Property. Keep your custom LayoutRotateBehavior in the pageviewer template, and make sure the Angle property is bound to some static view model that exposes the current angle. The new rotate button adjusts the angle which subsequently is read by the LayoutRotateBehavior.


Makes sense?


- Koen

Apr 26, 2012 at 2:35 PM

Hi Koen,

Thankyou; makes perfect sense!

I have re-used the parts of the current behavior by now.
Works perfect!

Gr,

Nick