Update
, , ! , ? , .
, , WP7 , , WP8 ( WP7).
, , . , -- , , .
, , . .
# ( LinqToVisualTree.cs
private void mainBrowser_Loaded(object sender, RoutedEventArgs e) {
var border = mainBrowser.Descendants<Border>().Last() as Border;
border.ManipulationDelta += border_ManipulationDelta;
border.ManipulationCompleted += border_ManipulationCompleted;
}
void border_ManipulationCompleted(object sender, ManipulationCompletedEventArgs e) {
mainBrowser.InvokeScript("onmanipulationcompleted");
}
void border_ManipulationDelta(object sender, ManipulationDeltaEventArgs e) {
var status = mainBrowser.InvokeScript("onmanipulationdelta") as string;
if (status == "top" || status == "both") {
if (e.DeltaManipulation.Translation.Y > 0) {
e.Handled = true;
}
}
if (status == "bottom" || status == "both") {
if (e.DeltaManipulation.Translation.Y < 0) {
e.Handled = true;
}
}
}
JS
window.manipulationTarget = null;
window.onmanipulationdelta = function () {
if (!window.manipulationTarget) {
return '';
}
var target = window.manipulationTarget;
var top = target.scrollTop == 0;
var bottom = target.scrollTop + target.clientHeight == target.scrollHeight;
return top ? bottom ? 'both' : 'top': bottom ? 'bottom' : '';
};
window.onmanipulationcompleted = function () {
window.manipulationTarget = null;
};
function preventBouncing(ele) {
ele.on('MSPointerDown pointerdown', function (e) {
window.manipulationTarget = this;
});
}
, . , ~