private void BtnChangeOffsetsWithAdditionalVelocity_Click(object sender, RoutedEventArgs e) { try { Vector2?inertiaDecayRate = null; if (txtCOWAVAIDR.Text != "null") { inertiaDecayRate = new Vector2( chkHorizontalOrientation.IsChecked == true ? Convert.ToSingle(txtCOWAVAIDR.Text) : 0, chkHorizontalOrientation.IsChecked == true ? 0 : Convert.ToSingle(txtCOWAVAIDR.Text)); } ScrollerChangeOffsetsWithAdditionalVelocityOptions options = new ScrollerChangeOffsetsWithAdditionalVelocityOptions( new Vector2( chkHorizontalOrientation.IsChecked == true ? Convert.ToSingle(txtCOWAVAV.Text) : 0, chkHorizontalOrientation.IsChecked == true ? 0 : Convert.ToSingle(txtCOWAVAV.Text)), inertiaDecayRate); txtStockOffsetsChangeDuration.Text = string.Empty; int viewChangeId = scroller.ChangeOffsetsWithAdditionalVelocity(options); AppendAsyncEventMessage("Invoked ChangeOffsetsWithAdditionalVelocity Id=" + viewChangeId); } catch (Exception ex) { txtExceptionReport.Text = ex.ToString(); lstScrollerEvents.Items.Add(ex.ToString()); } }
private void BtnScrollerOffsetChange_Click(object sender, RoutedEventArgs e) { try { double changeAmount = Convert.ToDouble(txtScrollerOffsetChange.Text); ScrollerChangeOffsetsWithAdditionalVelocityOptions options = new ScrollerChangeOffsetsWithAdditionalVelocityOptions(new Vector2(0.0f, (float)((changeAmount * 3) + 30)), null); markupScroller.ChangeOffsetsWithAdditionalVelocity(options); } catch (Exception ex) { txtExceptionReport.Text = ex.ToString(); } }