, , . Windows Phone 8 Windows Phone 8.1 (SilverLight).
#region stop zoom and scroll
public bool ScrollDisabled { get; set; }
private void WB_Loaded(object sender, RoutedEventArgs e)
{
var border = WB.Descendants<Border>().Last() as Border;
ScrollDisabled = true;
border.ManipulationDelta += Border_ManipulationDelta;
border.ManipulationCompleted += Border_ManipulationCompleted;
border.DoubleTap += border_DoubleTap;
}
void border_DoubleTap(object sender, System.Windows.Input.GestureEventArgs e)
{
e.Handled = true;
}
private void Border_ManipulationCompleted(object sender,
ManipulationCompletedEventArgs e)
{
if (e.FinalVelocities.ExpansionVelocity.X != 0.0 ||
e.FinalVelocities.ExpansionVelocity.Y != 0.0
||(ScrollDisabled && e.IsInertial))
{
e.Handled = true;
Debug.WriteLine("Scroll ManipulationCompleted");
}
}
private void Border_ManipulationDelta(object sender,
ManipulationDeltaEventArgs e)
{
if (e.DeltaManipulation.Scale.X != 0.0 ||
e.DeltaManipulation.Scale.Y != 0.0)
e.Handled = true;
if (ScrollDisabled)
{
if (e.DeltaManipulation.Translation.X != 0.0 ||
e.DeltaManipulation.Translation.Y != 0.0)
e.Handled = true;
}
}
#endregion
#,